var _version = "V2.0.170324";
exists = function (e) {
    if (!e)return !1;
    var t;
    var a = e.split(".");
    var n = !0;
    t = window;
    for (var r = 0; r < a.length; r++) {
        if (!t[a[r]]) {
            n = !1;
            break
        }
        t = t[a[r]]
    }
    return n
};
namespace = function (e) {
    var t;
    var a = e.split(".");
    if (exists(e)) {
    }
    t = window;
    for (var n = 0; n < a.length; n++) {
        if (!t[a[n]]) t[a[n]] = {};
        t = t[a[n]]
    }
};
var cx = {};
var gObj = {};
namespace("cx.frm");
namespace("cx.svr");
namespace("cx.ctrl");
namespace("cx.ui");
namespace("cx.plug");
cx.debug = !1;
cx.theme = "theme/def";
cx.env = {
    version: function () {
        var e = navigator.userAgent.toLowerCase();
        var t = {
            IE: /trident/.test(e),
            WebKit: /webkit/.test(e),
            FireFox: /gecko/.test(e) && e.indexOf("khtml") < 0,
            Opero: /presto/.test(e),
            IOS: /ipod|iphone|ipad/.test(e),
            ANDROID: /android/.test(e),
            WINDOWS: /windows/.test(e),
            IPHONE: /iphone/.test(e),
            IPAD: /ipad/.test(e),
            MOBILE: /mobile/.test(e),
            TOUCH_DEVICE: "ontouchstart" in window || /touch/.test(e),
            TABLET_ANDROID: !1,
            TABLET_WINDOWS: !1,
            TABLET: !1,
            SMART_PHONE: !1
        };
        t.TABLET_ANDROID = t.ANDROID && !t.MOBILE;
        t.TABLET_WINDOWS = t.WINDOWS && /tablet/.test(e);
        t.TABLET = t.IPAD || t.TABLET_ANDROID || t.TABLET_WINDOWS;
        t.SMART_PHONE = t.MOBILE && !t.TABLET;
        return t
    }
};
cx.isMobile = cx.env.version().SMART_PHONE;
Caller = function () {
    var e = function () {
        var e = this;
        var t = arguments;
        if (typeof t[0] == "function") {
            e.obj = null;
            e.func = t[0]
        } else if (typeof t[0] && typeof t[1] == "string") {
            e.obj = t[0];
            e.func = t[1]
        }
    };
    var t = function (e) {
        var t = this;
        var a;
        if (t.obj) {
            a = t.obj[t.func];
            if (a)return a.apply(t.obj, arguments)
        } else {
            a = t.func;
            if (a)return a.apply(null, arguments)
        }
    };
    e.prototype.call = t;
    return e
}();
cx.Exception = function () {
    var e = function (e) {
        var t = this;
        if (e instanceof Error) {
            t.errCode = 1;
            t.message = e.message;
            t.stack = e.stack
        } else if (e instanceof cx.Exception) {
            t.errCode = e.errCode;
            t.message = e.message;
            t.stack = e.stack
        }
    };
    var t = function () {
        return this.errCode
    };
    var a = function () {
        return this.message
    };
    var n = function () {
        return this.stack
    };
    var r = e.prototype;
    r.getErrCode = t;
    r.getMessage = a;
    r.getStack = n;
    return e
}();
cx.Event = {
    TOUCH_START: cx.isMobile ? "touchstart" : "mousedown",
    TOUCH_MOVE: cx.isMobile ? "touchmove" : "mousemove",
    TOUCH_END: cx.isMobile ? "touchend" : "mouseup",
    CLICK: cx.isMobile ? "vclick" : "click",
    MOUSE_MOVE: 1,
    LEFT_CLICK: 2,
    LEFT_DOUBLE_CLICK: 3,
    RIGHT_CLICK: 4,
    MOVE_START: 11,
    MOVE_END: 12,
    CAMERA_CHANGED: 13,
    SELECT_WMS_FEATURE: 21,
    SELECT_ENTITY: 22,
    OVER_ENTITY: 23,
    TERRAIN_CHANGE: 31,
    LAYER_CHANGE: 32,
    CLEAR_ENTITYS: 41
};
String.prototype.trim = function () {
    return this.replace(/(^\s*)|(\s*$)/g, "")
};
function addTip(e, t) {
    if (e) {
        $(e).tooltip({
            content: "<span>" + t + "</span>", onHide: function () {
                $(this).tooltip("destroy");
                addTip(e, t)
            }
        })
    }
}
function checkUsertype(e, t) {
    if (e != gObj.user.type) {
        window.location = t
    }
}
function setWaitInfo() {
    var e = cx.dom.byId("fetchingTip");
    e.style.background = "url(img/fetching.gif) no-repeat center center"
}
function cancelWaitInfo() {
    var e = cx.dom.byId("fetchingTip");
    e.style.background = "none"
}
cx._newId = 1;
cx._zIndex = 100;
cx.byId = function (e) {
    var t = cx.dom.byId(e);
    if (!t)return null;
    return t.wnd
};
cx.newId = function () {
    return "_" + this._newId++
};
cx.nextZIndex = function () {
    return this._zIndex++
};
cx.getMax = function (e, t) {
    if (!e.length)return 0;
    var a = e[0][t];
    for (var n = 1; n < e.length; n++) {
        if (a < e[n][t]) a = e[n][t]
    }
    return a
};
cx.isDef = function (e) {
    return e !== void 0
};
cx.isNull = function (e) {
    return e === null
};
cx.isNNull = function (e) {
    return e != null
};
cx.isNum = function (e) {
    return typeof e == "number" && !isNaN(e)
};
cx.isStr = function (e) {
    return typeof e == "string" || e instanceof String
};
cx.isArr = function (e) {
    return typeof e == "array" || e instanceof Array
};
cx.isObj = function (e) {
    var t = typeof e;
    return t == "object" && e || t == "function"
};
cx.isFunc = function (e) {
    return typeof e == "function"
};
cx.defaultValue = function (e, t) {
    return e !== void 0 ? e : t
};
cx.contains = function (e, t) {
    var a;
    if (this.isArr(e)) {
        for (a = 0; a < e.length; a++) {
            if (e[a] === t)return !0
        }
    } else if (this.isObj(e)) {
        for (a in e) {
            if (e[a] === t)return !0
        }
    }
    return !1
};
cx.inherits = function (e, t) {
    var a = function () {
    };
    a.prototype = t.prototype;
    e.superClass_ = t.prototype;
    e.prototype = new a;
    e.prototype.constructor = e
};
cx.base = function (e, t, a) {
    var n = arguments.callee.caller;
    var r;
    if (n.superClass_) {
        var i = [arguments.length - 1];
        for (r = 1; r < arguments.length; r++) {
            i[r - 1] = arguments[r]
        }
        return n.superClass_.constructor.apply(e, i)
    }
    var o = [arguments.length - 2];
    for (r = 2; r < arguments.length; r++) {
        o[r - 2] = arguments[r]
    }
    var c = !1;
    for (var s = e.constructor; s; s = s.superClass_ && s.superClass_.constructor) {
        if (s.prototype[t] === n) {
            c = !0
        } else if (c) {
            return s.prototype[t].apply(e, o)
        }
    }
};
cx.extend = function (e, t) {
    var a, n;
    for (var r = 1; r < arguments.length; r++) {
        n = arguments[r];
        for (a in n) {
            e[a] = n[a]
        }
    }
    return e
};
cx.setBaseURL = function () {
    var e = window.location.pathname.substring(1);
    var t = e.indexOf("/");
    if (t > 0) {
        this.baseURL = "/" + e.substr(0, t) + "/"
    } else {
        delete this.baseURL
    }
};
cx.ajax = function () {
    var constructor = function () {
    };
    var post = function (e, t, a, n) {
        $.ajax({
            type: "POST",
            url: (cx.baseURL && cx.baseURL != "" ? cx.baseURL : "") + e,
            dataType: "json",
            data: t,
            cache: !0,
            success: function (e, r) {
                if (e && e.length == 1 && e[0].ret !== void 0) {
                    if (e[0].ret == 0) {
                        if (a == 1 && t.filename && t.filename != "") cx.file.deleteFile(t.filename, null);
                        n(t, e[0])
                    } else if (e[0].ret == 1) {
                        if (a == 2 && t.filename && t.filename != "") cx.file.deleteFile(t.filename, null);
                        if (e[0].errcode) {
                            cx.msg.dispErrCode(e[0].errcode)
                        } else if (e[0].msg) {
                            e[0].message = e[0].msg;
                            cx.msg.errorProc(e[0])
                        }
                    } else if (e[0].msg) {
                        if (a == 2 && t.filename && t.filename != "") cx.file.deleteFile(t.filename, null);
                        cx.msg.dispError(e[0].msg)
                    }
                } else {
                    if (a == 1 && t.filename && t.filename != "") cx.file.deleteFile(t.filename, null);
                    n(t, e)
                }
            },
            error: function (e, t, a) {
                alert("")
            }
        })
    };
    var loadJs = function (e) {
        var t = !1;
        if (exists(e.className)) {
            if (e.onLoad) e.onLoad.call()
        } else {
            var a = cx.dom.getDomNode("cx-scr" + "ipts") || cx.dom.body();
            var n = document.createElement("script");
            n.setAttribute("src", e.url);
            n.onload = function () {
                if (e.onLoad) e.onLoad.call()
            };
            a.appendChild(n)
        }
    };
    var loadClass = function (options) {
        if (exists(options.className)) {
            if (options.onLoad) options.onLoad.call()
        } else {
            $.ajax({
                type: "POST", url: options.url, dataType: "text", cache: !1, success: function (data, status) {
                    eval(data);
                    if (options.onLoad) options.onLoad.call(data)
                }, error: function (e, t, a) {
                    if (options.onError) options.onError.call()
                }
            })
        }
    };
    var loadCss = function (e) {
        var t = document.getElementsByTagName("head")[0];
        var a = document.createElement("link");
        a.setAttribute("rel", "stylesheet");
        a.setAttribute("type", "text/css");
        a.setAttribute("href", e.url);
        a.onload = function () {
            if (e.onLoad) e.onLoad.call()
        };
        t.appendChild(a)
    };
    var loadText = function (e) {
        $.ajax({
            type: "POST", url: e.url, dataType: "text", cache: !0, success: function (t, a) {
                if (e.onLoad) e.onLoad.call(t)
            }, error: function (t, a, n) {
                if (e.onError) e.onError.call()
            }
        })
    };
    var loadHtml = function (e) {
        $(cx.dom.getDomNode(e.dom)).html(gObj.loc.loading);
        var t = function (t, a) {
            if (e.onReplaceId) t = e.onReplaceId.call(t);
            cx.dom.setContent(e.dom, t);
            if (e.onLoad) e.onLoad.call(t)
        };
        var a = gObj.htmlCache.get(e.url);
        if (a) {
            t(a, null)
        } else {
            $.ajax({
                type: "POST", url: e.url, dataType: "text", cache: !0, success: t, error: function (t, a, n) {
                    $(cx.dom.getDomNode(e.dom)).html(gObj.loc.msgErrInfo);
                    if (e.onError) e.onError.call()
                }
            })
        }
    };
    constructor.post = post;
    constructor.loadJs = loadJs;
    constructor.loadClass = loadClass;
    constructor.loadCss = loadCss;
    constructor.loadText = loadText;
    constructor.loadHtml = loadHtml;
    return constructor
}();
cx.array = function () {
    var e = function () {
    };
    var t = function (e) {
        return e.length == 0
    };
    var a = function (e, t) {
        for (var a = e.length - 1; a >= 0; a--) {
            if (e[a] === t)return !0
        }
        return !1
    };
    var n = function (e, t, a) {
        for (var n = 0; n < e.length; n++) {
            if (t.call(a, e[n]))break
        }
    };
    var r = function (e) {
        for (var t = e.length - 1; t >= 0; t--) {
            delete e[t]
        }
        e.length = 0
    };
    var i = function (e, t) {
        for (var a = e.length - 1; a >= 0; a--) {
            if (e[a] === t)return a
        }
        return -1
    };
    var o = function (e, t) {
        var a;
        var n, r;
        for (n in e) {
            a = !0;
            for (r in t)if (e[n][r] != t[r]) a = !1;
            if (a)return e[n]
        }
        return null
    };
    var c = function (e, t) {
        var a = [];
        var n;
        var r, i;
        for (r in e) {
            n = !0;
            for (i in t)if (e[r][i] != t[i]) {
                n = !1;
                break
            }
            if (n) a.push(e[r])
        }
        return a
    };
    var s = function (e, t) {
        var a = [];
        var n;
        var r, i;
        for (r in e) {
            n = !0;
            for (i in t)if (e[r][i] == t[i]) {
                n = !1;
                break
            }
            if (n) a.push(e[r])
        }
        return a
    };
    var l = function (e, t, a) {
        var n = [];
        for (var r in e) {
            if (e[r][t].indexOf(a) < 0) n.push(e[r])
        }
        return n
    };
    var d = function (e, t, a) {
        var n = [];
        for (var r in e) {
            if (e[r][t].indexOf(a) > -1) n.push(e[r])
        }
        return n
    };
    var u = function (e, t) {
        e.unshift(t)
    };
    var f = function (e, t, a) {
        if (!cx.isArr(t)) {
            e.splice(a, 0, t)
        } else {
            for (var n = val.length - 1; n >= 0; n--) {
                e.splice(a, 0, t[n])
            }
        }
    };
    var v = function (e, t) {
        var a = arguments;
        if (e) {
            for (var n = 1; n < a.length; n++) {
                if (a[n]) e.push(a[n])
            }
        }
    };
    var g = function (e, t) {
        var a;
        var n, r;
        for (n = e.length - 1; n >= 0; n--) {
            a = !0;
            for (r in t)if (e[n][r] != t[r]) {
                a = !1;
                break
            }
            if (a) e.splice(n, 1)
        }
    };
    var h = function (e, t, a) {
        e.splice(t, a)
    };
    var x = function (e, t, a) {
        var n;
        var r, i;
        for (r in e) {
            n = !0;
            for (i in t)if (e[r][i] != t[i]) {
                n = !1;
                break
            }
            if (n) {
                e[r] = a;
                break
            }
        }
    };
    var m = function (e, t, a) {
        if (t) {
            for (var n = 0; n < t.length; n++) {
                if (!a || !cx.array.has(t[n])) e.push(t[n])
            }
        }
    };
    var p = function (e, t, a) {
        var n = "";
        a = a || ",";
        if (cx.isArr(e)) {
            for (var r = 0; r < e.length; r++) {
                if (cx.isObj(e[r])) n += e[r][t] + a; else n += e[r] + a
            }
            n = n.substr(0, n.lastIndexOf(a))
        }
        return n
    };
    e.isEmpty = t;
    e.has = a;
    e.forEach = n;
    e.clear = r;
    e.indexOf = i;
    e.get1 = o;
    e.gets = c;
    e.getsNot = s;
    e.getsNotFuz = l;
    e.getsFuz = d;
    e.insert = u;
    e.insertAt = f;
    e.append = v;
    e.remove = g;
    e.removeAt = h;
    e.update = x;
    e.merge = m;
    e.toString = p;
    return e
}();
cx.att = function () {
    var e = function () {
    };
    var t = function (e, t, a) {
        var n;
        var r = gObj.field.getFlds(a);
        var i;
        var o, c;
        for (c = 0; c < r.length; c++) {
            n = r[c];
            if (n.colname == t) {
                switch (n.disptype) {
                    case 2:
                    case 6:
                        i = gObj.field.getFldvalues(a, n.colname);
                        if (i) {
                            for (o = 0; o < i.length; o++) {
                                if (i[o].dbvalue == e) {
                                    return gLoc ? i[o].dispc : i[o].dispe
                                }
                            }
                        }
                        break;
                    case 3:
                        if (e != "") {
                            return e.substring(0, 10)
                        }
                        break;
                    default:
                        return e
                }
            }
        }
        return e
    };
    e.getDispValue = t;
    return e
}();
cx.cache = function () {
    var e = function () {
    };
    var t = function (e, t) {
        localStorage.setItem(e, t)
    };
    var a = function (e) {
        var t = localStorage.getItem(e);
        return t ? t : ""
    };
    var n = function (e) {
        localStorage.removeItem(e)
    };
    var r = function () {
        localStorage.clear()
    };
    e.set = t;
    e.get = a;
    e.remove = n;
    e.clear = r;
    return e
}();
cx.checkbox = function () {
    var e = function () {
    };
    var t = function (e) {
        var t = [];
        var a = $("input[type=checkbox][name=" + e + "]");
        for (var n = 0; n < a.length; n++) {
            if (a[n].checked) {
                t.push(a[n].value)
            }
        }
        return t
    };
    var a = function (e, t) {
        var a = cx.dom.getDomNode(e);
        if (a) {
            $(a).prop("checked", t)
        }
    };
    e.getChecked = t;
    e.setCheck = a;
    return e
}();
cx.color = {
    hexToRgb: function (e, t) {
        var a = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
        var e = e.toLowerCase();
        var n;
        if (e && a.test(e)) {
            if (e.length === 4) {
                var r = "#";
                for (n = 1; n < 4; n++) {
                    r += e.slice(n, n + 1).concat(e.slice(n, n + 1))
                }
                e = r
            }
            var i = [];
            for (n = 1; n < 7; n += 2) {
                i.push(parseInt("0x" + e.slice(n, n + 2)))
            }
            if (t)return "rgb(" + i[0] + "," + i[1] + "," + i[2] + ")"; else return i
        } else {
            return e
        }
    }, rgbToHex: function (e) {
        var t = e;
        var a = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
        var n;
        if (/^(rgb|RGB)/.test(t)) {
            var r = t.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
            var i = "#";
            for (n = 0; n < r.length; n++) {
                var o = Number(r[n]).toString(16);
                o = o < 10 ? 0 + "" + o : o;
                if (o === "0") {
                    o += o
                }
                i += o
            }
            if (i.length !== 7) {
                i = t
            }
            return i
        } else if (a.test(t)) {
            var c = t.replace(/#/, "").split("");
            if (c.length === 6) {
                return t
            } else if (c.length === 3) {
                var s = "#";
                for (n = 0; n < c.length; n++) {
                    s += c[n] + c[n]
                }
                return s
            }
        } else {
            return t
        }
    }, rgbToRgba: function (e, t, a) {
        var n = e;
        if (/^(rgb|RGB)/.test(n)) {
            var r = n.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
            r.push(t);
            if (a)return "rgba(" + r[0] + "," + r[1] + "," + r[2] + "," + r[3] + ")"; else return r
        } else return e
    }
};
namespace("cx.consts");
namespace("cx.major");
namespace("cx.minor");
cx.consts = {
    DISP_TEXTBOX: 1,
    DISP_LIST: 2,
    DISP_DATE: 3,
    DISP_RTEXT: 4,
    DISP_DATETIME: 5,
    DISP_DROPDOWN: 6,
    DISP_VALBUTTON: 7,
    INTENT_JS: 1,
    INTENT_CSS: 2,
    INTENT_TEXT: 3,
    INTENT_CHECK_DATA: 4,
    NTENT_LOAD_DATA: 5,
    ENTITY_TABLE: 1,
    ENTITY_PNT: 2,
    ENTITY_LIN: 3,
    ENTITY_REG: 4,
    ENTITY_NOTE: 5,
    UI_DIALOG: 1,
    UI_TABPAGE: 2,
    UI_PANE: 3,
    UI_FLATPAGE: 4,
    UI_MOBILEPAGE: 5,
    UI_POPUP: 6,
    FILE_DOC: 1,
    FILE_IMG: 2,
    FILE_VIDEO: 3,
    FILE_AUDIO: 4,
    DELFILE_NO: 0,
    DELFILE_SUCCESS: 1,
    DELFILE_FAIL: 2,
    REG_NORTH: 1,
    REG_WEST: 2,
    REG_EAST: 3,
    REG_SOUTH: 4,
    REG_CENTER: 5,
    POS_TOP: 1,
    POS_BOTTOM: 2,
    POS_LEFT: 3,
    POS_RIGHT: 4,
    DIR_TOP: 1,
    DIR_BOTTOM: 2,
    DIR_LEFT: 3,
    DIR_RIGHT: 4,
    OPENFILE_OPEN: 1,
    OPENFILE_SAVE: 2,
    RES_FILE: 0,
    RES_URL: 1,
    RES_LINK: 2,
    SYSTAB: 99,
    SYSUSER: 14,
    PX: "px",
    REGIONS: ["north", "west", "east", "south", "center"],
    POSITIONS: ["top", "bottom", "left", "right"],
    getRegion: function (e) {
        for (var t = 0; t < this.REGIONS.length; t++) {
            if (e == this.REGIONS[t]) {
                return this.REG_NORTH + t
            }
        }
        return 0
    },
    getPosition: function (e) {
        for (var t = 0; t < this.POSITIONS.length; t++) {
            if (e == this.POSITIONS[t]) {
                return this.POS_TOP + t
            }
        }
        return 0
    },
    getDirection: function (e) {
        for (var t = 0; t < this.POSITIONS.length; t++) {
            if (e == this.POSITIONS[t]) {
                return this.DIR_TOP + t
            }
        }
        return 0
    }
};
cx.control = function () {
    var e = function () {
    };
    var t = function (e, t) {
        switch (e) {
            case 1:
                if (t.disprows !== void 0 && t.disprows > 1)return this.dispTextArea(t); else return this.dispTextBox(t);
                break;
            case 2:
                return this.dispSelect(t);
            case 3:
                return this.dispDate(t);
            case 4:
                return this.dispEditor(t);
            case 6:
                return this.dispDropdown(t);
            default:
                return null
        }
    };
    var a = function (e) {
        var t = "";
        if (e && e.dijit) {
            switch (e.type) {
                case"textbox":
                    t = e.dijit.val();
                    break;
                case"combobox":
                    t = e.dijit.combobox("getValue");
                    break;
                case"datebox":
                    var a = e.dijit.datebox("getValue");
                    if (a && a != "") {
                        if (gLoc) t = cx.date.format(cx.date.parse(a)); else t = cx.date.format(cx.date.parse1(a))
                    }
                    break
            }
        }
        return t
    };
    var n = function (e) {
        var t = $(cx.dom.create("input", e.className, e.dom, null));
        t.textbox({disabled: !1});
        t.textbox("setValue", e.val);
        return {dijit: t, type: "textbox"}
    };
    var r = function (e) {
        var t = $(cx.dom.create("input", e.className, e.dom, null));
        t.textbox({multiline: !0, height: 18 * e.disprows, disabled: !1});
        t.textbox("setValue", e.val);
        return {dijit: t, type: "textbox"}
    };
    var i = function (e) {
        var t = $(cx.dom.create("input", e.className + " ", e.dom, null));
        t.combobox({editable: !1, disabled: !1});
        cx.select.setOpts(t, e.opts, "dbvalue", gLoc ? "dispc" : "dispe", e.val);
        if (e.val && e.val != "") {
            t.combobox("setValue", e.val)
        }
        return {dijit: t, type: "combobox"}
    };
    var o = function (e) {
        var t = $(cx.dom.create("input", e.className, e.dom, null));
        t.combobox({editable: !0, disabled: !1});
        cx.select.setOpts(t, e.opts, "dbvalue", gLoc ? "dispc" : "dispe", e.val);
        if (e.val && e.val != "") {
            t.combobox("setValue", e.val)
        }
        return {dijit: t, type: "combobox"}
    };
    var c = function (e) {
        var t = $(cx.dom.create("input", e.className, e.dom, null));
        t.datebox({disabled: !1, currentText: gObj.loc.today, closeText: gObj.loc.close});
        if (e.val && e.val != "") {
            if (gLoc) t.datebox("setValue", cx.date.format(cx.date.parse(e.val))); else t.datebox("setValue", cx.date.format1(cx.date.parse(e.val)))
        }
        return {dijit: t, type: "datebox"}
    };
    var s = function (e) {
        var t = $(cx.dom.create("textarea", e.className, e.dom, {rows: e.disprows}));
        t.xheditor({
            tools: "Fontface,FontSize,FontColor,BackColor,|,Bold,Italic,Underline,Strikethrough,|,SelectAll,Removeformat,/,Cut,Copy,Paste,Pastetext,|,Blocktag,Align,List,Outdent,Indent,|,Hr,Emot,Table,Link,Unlink,Anchor,Img,Flash,Media,|,Preview,Print,Fullscreen",
            skin: "o2007silver",
            readonly: !1,
            height: e.disprows * 15 + 25,
            width: 700
        });
        t.val(e.val);
        return {dijit: t, type: "textarea"}
    };
    e.dispFld = t;
    e.getValue = a;
    e.dispTextBox = n;
    e.dispTextArea = r;
    e.dispSelect = i;
    e.dispDropdown = o;
    e.dispDate = c;
    e.dispEditor = s;
    return e
}();
cx.cvt = function () {
    var constructor = function () {
    };
    var toHtml = function (e) {
        e = e.replace(/\n/g, "<br/>");
        e = e.replace(/ /g, "&nbsp;");
        return e
    };
    var toObject = function (str) {
        if (cx.isObj(str))return str;
        if (!str)return null; else if (str === "")return {}; else return eval("(" + str + ")")
    };
    var permToString = function (e) {
        var t = "{";
        if (e) {
            var a = 0;
            for (var n in e) {
                if (a > 0) t += ",";
                var r = e[n];
                if (typeof r == "string") {
                    t += '"' + n + '":';
                    t += r
                } else {
                    t += '"' + n + '":[';
                    for (var i = 0; i < r.length; i++) {
                        if (i > 0) t += ",";
                        t += '"' + r[i] + '"'
                    }
                    t += "]"
                }
                a++
            }
        }
        t += "}";
        return t
    };
    var data2String = function (e, t) {
        var a = "";
        if (t == !0 && e instanceof Object) {
            a = JSON.stringify(e, function e(t, a) {
                if (typeof a == "number" || typeof a == "boolean") {
                    a += ""
                }
                return a
            })
        } else {
            a = JSON.stringify(e)
        }
        return a
    };
    constructor.toHtml = toHtml;
    constructor.toObject = toObject;
    constructor.permToString = permToString;
    constructor.data2String = data2String;
    return constructor
}();
cx.datagrid = function () {
    var e = function () {
    };
    var t = function (e) {
        return cx.dijit.getDijit(e).datagrid("getRows")
    };
    var a = function (e, t) {
        var a = cx.dijit.getDijit(e);
        var n = a.datagrid("getRows");
        var r;
        if (typeof t == "number") {
            for (r = n.length - 1; r >= 0; r--)if (n[r].id == t)return r
        } else {
            if (t.id !== void 0) {
                for (r = n.length - 1; r >= 0; r--)if (n[r].id == t.id)return r
            }
        }
        return a.datagrid("getRowIndex", t)
    };
    var n = function (e, t, a) {
        if (t && t.length > 0) {
            var n = cx.dijit.getDijit(e);
            for (var r = 0; r < t.length; r++) {
                if (a) a(t[r], r);
                n.datagrid("insertRow", {index: r, row: t[r]})
            }
        }
    };
    var r = function (e, t) {
        cx.dijit.getDijit(e).datagrid("insertRow", {index: 0, row: t})
    };
    var i = function (e, t) {
        var a = cx.dijit.getDijit(e);
        a.datagrid("deleteRow", this.getRowIndex(a, t))
    };
    var o = function (e, t, a) {
        var n = cx.dijit.getDijit(e);
        n.datagrid("updateRow", {index: this.getRowIndex(n, a), row: t})
    };
    var c = function (e) {
        var t = cx.dijit.getDijit(e);
        var a = t.datagrid("getRows");
        for (var n = a.length - 1; n >= 0; n--) {
            t.datagrid("deleteRow", n)
        }
    };
    var s = function (e) {
        return cx.dijit.getDijit(e).datagrid("getSelected")
    };
    var l = function (e) {
        return cx.dijit.getDijit(e).datagrid("getSelections")
    };
    var d = function (e, t, a, n, r) {
        var i = cx.dijit.getDijit(e);
        t.preventDefault();
        i.datagrid("clearSelections");
        i.datagrid("selectRow", a);
        $(cx.dijit.getId(r)).menu("show", {left: t.pageX, top: t.pageY});
        t.preventDefault()
    };
    var u = function (e, t, a) {
        var n = cx.dijit.getDijit(e);
        var r = n.datagrid("getData").rows[t];
        var i = n.datagrid("getData").rows[a];
        n.datagrid("getData").rows[t] = i;
        n.datagrid("getData").rows[a] = r;
        n.datagrid("refreshRow", t);
        n.datagrid("refreshRow", a);
        n.datagrid("clearSelections")
    };
    var f = function (e) {
        var t = cx.dijit.getDijit(e);
        var a = t.datagrid("getSelected");
        var n = t.datagrid("getRowIndex", a);
        if (n > 0) {
            this.swap(t, n, n - 1);
            t.datagrid("selectRow", n - 1)
        }
    };
    var v = function (e) {
        var t = cx.dijit.getDijit(e);
        var a = t.datagrid("getSelected");
        var n = t.datagrid("getRowIndex", a);
        var r = t.datagrid("getRows").length;
        if (n != r - 1) {
            this.swap(t, n, n + 1);
            t.datagrid("selectRow", n + 1)
        }
    };
    var g = function (e) {
        var t = cx.dijit.getDijit(e);
        var a = t.datagrid("getSelected");
        var n = t.datagrid("getRowIndex", a);
        if (n != 0) {
            this.swap(t, n, 0);
            t.datagrid("selectRow", 0)
        }
    };
    var h = function (e) {
        var t = cx.dijit.getDijit(e);
        var a = t.datagrid("getSelected");
        var n = t.datagrid("getRowIndex", a);
        var r = t.datagrid("getRows").length;
        if (n != r - 1) {
            this.swap(t, n, r - 1);
            t.datagrid("selectRow", r - 1)
        }
    };
    var x = function (e) {
        var t = cx.dijit.getDijit(e);
        var a = t.datagrid("getSelections");
        if (a.length == 2) {
            var n = t.datagrid("getRowIndex", a[0]);
            var r = t.datagrid("getRowIndex", a[1]);
            this.swap(t, n, r);
            t.datagrid("selectRow", n);
            t.datagrid("selectRow", r)
        }
    };
    var m = function (e) {
        var t = cx.dijit.getDijit(e);
        if (t) {
            t.datagrid({striped: !0})
        }
    };
    e.getRows = t;
    e.getRowIndex = a;
    e.disp = n;
    e.add = r;
    e.remove = i;
    e.update = o;
    e.clear = c;
    e.getSelected = s;
    e.getSelections = l;
    e.onRowContextMenu = d;
    e.swap = u;
    e.moveUp = f;
    e.moveDown = v;
    e.moveFirst = g;
    e.moveLast = h;
    e.exchange = x;
    e.setStriped = m;
    return e
}();
cx.datalist = function () {
    var e = function () {
    };
    var t = function (e, t, a, n, r) {
        var i = cx.dijit.getDijit(e);
        i.datalist({data: t, valueField: a, textField: n, singleSelect: !r ? !1 : !!r})
    };
    var a = function (e) {
        return cx.dijit.getDijit(e).datalist("getSelections")
    };
    var n = function (e) {
        return cx.dijit.getDijit(e).datalist("getSelected")
    };
    var r = function (e) {
        var t = cx.dijit.getDijit(e);
        if (t) {
            t.datalist({striped: !0})
        }
    };
    e.dispToList = t;
    e.getSelects = a;
    e.getSelected = n;
    e.setStriped = r;
    return e
}();
cx.date = function () {
    var e = function () {
    };
    var t = function (e) {
        if (e && e != "") {
            var t;
            t = e.split("-");
            if (t.length == 3)return !0;
            t = e.split("/");
            if (t.length == 3)return !0
        }
        return !1
    };
    var a = function (e) {
        if (!this.isDate(e))return null;
        var t = e.indexOf(" ") > 0 ? e.indexOf(" ") : e.length;
        e = e.substring(0, t);
        e = e.replace(new RegExp("\\-", "gi"), "/");
        return new Date(e)
    };
    var n = function (e) {
        if (!this.isDate(e))return null;
        var t = e.indexOf(" ") > 0 ? e.indexOf(" ") : e.length;
        e = e.substring(0, t);
        var a = e.split("/");
        return new Date(a[2] + "/" + a[0] + "/" + a[1])
    };
    var r = function (e) {
        if (e) {
            if (typeof e == "string") {
                e = this.parse(e)
            }
            return e.getFullYear() + "-" + (e.getMonth() + 1) + "-" + e.getDate()
        }
        return ""
    };
    var i = function (e) {
        if (e)return e.getMonth() + 1 + "/" + e.getDate() + "/" + e.getFullYear();
        return ""
    };
    var o = function (e) {
        if (e)return this.format(e) + " " + this.formatTime(e);
        return ""
    };
    var c = function (e) {
        if (e)return this.format(e) + " " + this.formatHour(e);
        return ""
    };
    var s = function (e) {
        if (e)return e.getHours() + ":" + e.getMinutes() + ":" + e.getSeconds();
        return ""
    };
    var l = function (e) {
        if (e)return e.getHours() + ":00:00";
        return ""
    };
    var d = function (e, t) {
        return e.getYear() == t.getYear() && e.getMonth() == t.getMonth() && e.getDate() == t.getDate()
    };
    var u = function (e, t, a) {
        return e >= t && e <= a
    };
    var f = function (e) {
        var t = null;
        if (cx.isNum(e)) t = e; else if (e instanceof Date) t = e.getFullYear();
        if (!t)return !1; else {
            return t % 4 == 0 && (t % 100 != 0 || t % 400 == 0)
        }
    };
    var v = function (e) {
        var t = {1: 31, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31};
        var a = null;
        var n = null;
        if (arguments[0] instanceof Date) {
            a = arguments[0].getFullYear();
            n = arguments[0].getMonth() + 1
        } else {
            a = arguments[0];
            n = arguments[1]
        }
        if (n == 2) {
            if (this.isLeapYear(a))return 29; else return 28
        }
        return t[n]
    };
    var g = function (e, t) {
        var a = new Date;
        a.setTime(e.getTime() + t * 864e5);
        return a
    };
    var h = function (e, t) {
        return (e - t) / 864e5
    };
    var x = function (e, t) {
        return (t ? gObj.loc.week : "") + gObj.loc["dayName" + e]
    };
    var m = function (e) {
        return this.format(this.parse1(e))
    };
    var p = function (e) {
        return this.format1(this.parse(e))
    };
    var b = function (e) {
        return "to_date('" + this.format(this.parse1(e)) + "','YYYY-MM-DD')"
    };
    var y = function (e) {
        return "to_date('" + e + "','YYYY-MM-DD')"
    };
    var w = function (e) {
        return "to_date('" + e + "','YYYY-MM-DD hh24:mi:ss')"
    };
    var C = function (e, t, a, n) {
        var r = "";
        if (e == "postgresql") {
            r = (n && n != "" ? n + "." : "") + t + "=to_date('" + a + "','yyyy-mm-dd')"
        } else {
            r = (n && n != "" ? n + "." : "") + t + " like to_date('" + a + "','yyyy-mm-dd')"
        }
        return r
    };
    e.isDate = t;
    e.parse = a;
    e.parse1 = n;
    e.format = r;
    e.format1 = i;
    e.formatDatetime = o;
    e.formatDatehour = c;
    e.formatTime = s;
    e.formatHour = l;
    e.equals = d;
    e.isIn = u;
    e.isLeapYear = f;
    e.getDayNumByMonth = v;
    e.addDays = g;
    e.diffDays = h;
    e.getDayName = x;
    e.MDY2YMD = m;
    e.YMD2MDY = p;
    e.MDY2SQL = b;
    e.YMD2SQL = y;
    e.YMDHMS2SQL = w;
    e.sqlDate = C;
    return e
}();
cx.dijit = function () {
    var e = function () {
    };
    var t = function (e) {
        return "#" + e
    };
    var a = function (e) {
        return $("#" + e)
    };
    var n = function (e) {
        if (typeof e == "string")return this.byId(e);
        return e
    };
    var r = function (e) {
        var t = ["easyui-textbox", "easyui-combobox", "easyui-datebox", "easyui-linkbutton", "easyui-datagrid", "easyui-tabs", "easyui-datalist", "easyui-accordion", "easyui-combotree", "easyui-slider", "easyui-datetimebox"];
        for (var a in t) {
            if (e.hasClass(t[a]))return t[a].substr(7)
        }
        return ""
    };
    var i = function (e, t) {
        var a = this.getDijit(e);
        if (a.length > 0) a[this.getType(a)](t ? "enable" : "disable")
    };
    var o = function (e) {
        var t;
        t = cx.byId(e);
        if (t)return t.val();
        t = cx.dijit.getDijit(e);
        if (t) {
            if (t.length > 0)return t[this.getType(t)]("getValue")
        }
        t = cx.dom.getDomNode(e);
        if (t)return cx.dom.getValue(t);
        return null
    };
    var c = function (e, t) {
        var a = this.getDijit(e);
        if (a.length > 0) a[this.getType(a)]("setValue", t)
    };
    var s = function (e, t) {
        var a = this.getDijit(e);
        if (a.length > 0) {
            a[this.getType(a)](t)
        }
    };
    var l = function (e, t, a) {
        var n = cx.dom.getDomNode(t);
        if (n) {
            cx.dom.empty(n)
        }
        var r = this.getValue(e);
        var i = cx.newId();
        var o, c, s, l;
        if (!a || a.length == 0) {
            o = cx.dom.create("input", "easyui-textbox w_130", n, {id: i, type: "text"});
            $(o).textbox({multiline: !1});
            return i
        }
        for (var d = 0; d < a.length; d++) {
            if (a[d].colname == r) {
                l = a[d];
                break
            }
        }
        if (l) {
            switch (l.disptype) {
                default:
                case 1:
                    o = cx.dom.create("input", "easyui-textbox w_130", n, {id: i, type: "text"});
                    $(o).textbox({multiline: l.disprows > 1});
                    return i;
                case 2:
                    o = cx.dom.create("select", "easyui-combobox w_130 b_no", n, {id: i});
                    c = $(this.getId(i)).combobox({editable: !1});
                    s = gObj.field.getFldvalues(l.tabname, r);
                    if (s) cx.select.setOpts(i, s, "dbvalue", gLoc ? "dispc" : "dispe", null);
                    return i;
                case 3:
                    o = cx.dom.create("input", "easyui-datebox w_130", n, {id: i});
                    c = $(this.getId(i)).datebox({currentText: gObj.loc.today, closeText: gObj.loc.close});
                    c.datebox("setValue", cx.date.format1(cx.date.parse(gObj.loc.today)));
                    return i;
                case 6:
                    o = cx.dom.create("select", "easyui-combobox w_130 b_no", n, {id: i});
                    c = $(this.getId(i)).combobox({editable: !0});
                    s = gObj.field.getFldvalues(l.tabname, r);
                    if (s) cx.select.setOpts(i, s, "dbvalue", gLoc ? "dispc" : "dispe", null);
                    return i;
                case 7:
                    o = cx.dom.create("div", "cx-valbutton w_130", n, {id: i});
                    var u = gObj.field.getFldvalues(l.tabname, l.colname);
                    var f = cx.array.get1(u, {dbvalue: "BS"});
                    s = cx.parser.getOptions(f.dispc);
                    c = new cx.ctrl.ValButton(cx.extend({}, s));
                    c.create(o);
                    return i
            }
        }
    };
    e.getId = t;
    e.byId = a;
    e.getDijit = n;
    e.getType = r;
    e.enable = i;
    e.getValue = o;
    e.setValue = c;
    e.bind = s;
    e.addDijit = l;
    return e
}();
cx.dom = function () {
    var e = function () {
    };
    var t = function (e) {
        return document.getElementById(e)
    };
    var a = function (e) {
        if (typeof e == "string")return this.byId(e);
        return e
    };
    var n = function () {
        return document.body
    };
    var r = function (e, t) {
        var a = this.getDomNode(e);
        if (a) a.disabled = !t
    };
    var i = function (e) {
        var t = this.getDomNode(e);
        if (t)return t.value;
        return null
    };
    var o = function (e, t) {
        var a = this.getDomNode(e);
        if (a) a.value = t
    };
    var c = function (e, t) {
        var a = this.getDomNode(e);
        if (a) a.innerHTML = t
    };
    var s = function (e, t) {
        var a = this.getDomNode(e);
        if (a) {
            a.innerHTML = t;
            $.parser.parse($(a));
            cx.parser.parse(a);
            cx.layout.resize(a)
        }
    };
    var l = function (e, t) {
        var a = this.getDomNode(e);
        if (a) a.style.display = t ? "block" : "none"
    };
    var d = function (e, t) {
        var a = this.getDomNode(e);
        if (a) {
            cx.extend(a.style, t)
        }
    };
    var u = function (e, t) {
        var a = this.getDomNode(e);
        if (a) {
            a.style.zIndex = t
        }
    };
    var f = function (e, t) {
        var a = this.getDomNode(e);
        if (a) cx.extend(a, t)
    };
    var v = function (e) {
        var t = this.getDomNode(e);
        if (t) t.innerHTML = ""
    };
    var g = function (e, t, a, n) {
        var r = document.createElement(e);
        if (t && t != "") {
            r.className = t
        }
        if (n) {
            if (n.style) {
                r.style.cssText = n.style;
                delete n.style
            }
            cx.extend(r, n)
        }
        a = this.getDomNode(a);
        if (a) a.appendChild(r);
        return r
    };
    var h = function (e, t, a, n, r) {
        var i = document.createElementNS(e, t);
        if (a && a != "") {
            i.setAttribute("class", a)
        }
        if (r) {
            if (r.style) {
                i.style.cssText = r.style;
                delete r.style
            }
            for (var o in r) {
                i.setAttribute(o, r[o])
            }
        }
        n = this.getDomNode(n);
        if (n) n.appendChild(i);
        return i
    };
    var x = function (e, t) {
        var a = this.getDomNode(t);
        if (a) {
            var n;
            if (cx.isArr(e)) {
                for (var r = 0; r < e.length; r++) {
                    n = this.getDomNode(e[r]);
                    if (n) a.appendChild(n)
                }
            } else {
                n = this.getDomNode(e);
                if (n) a.appendChild(n)
            }
        }
    };
    var m = function (e, t) {
        var a = this.getDomNode(e);
        var n = this.getDomNode(t);
        if (a && n && n.parentNode) {
            if (n.nextSibling) {
                n.parentNode.insertBefore(a, n.nextSibling)
            } else {
                n.parentNode.appendChild(a)
            }
        }
    };
    var p = function (e, t) {
        var a = this.getDomNode(e);
        var n = this.getDomNode(t);
        if (a && n && n.parentNode) {
            n.parentNode.insertBefore(a, n)
        }
    };
    var b = function (e, t) {
        var a = this.getDomNode(e);
        var n = this.getDomNode(t);
        if (a && n) {
            if (n.childNodes.length > 0) {
                n.insertBefore(a, n.childNodes[0])
            } else {
                n.appendChild(a)
            }
        }
    };
    var y = function (e) {
        var t = this.getDomNode(e);
        if (t && t.parentNode) {
            t.parentNode.removeChild(t)
        }
    };
    var w = function (e) {
        var t = document.createElement("style");
        t.setAttribute("type", "text/css");
        var a = document.createTextNode(e);
        t.appendChild(a);
        var n = document.getElementsByTagName("head");
        n[0].appendChild(t)
    };
    var C = function (e, t) {
        var a = this.getDomNode(e);
        if (a) a.style.backgroundColor = t
    };
    var D = function (e) {
        var t = this.getDomNode(e);
        if (t)return t.style.backgroundColor
    };
    var S = function (e) {
        var t = this.getDomNode(e);
        if (t) {
            if (t.clientWidth)return {w: t.clientWidth, h: t.clientHeight};
            if (t.offsetWidth)return {w: t.offsetWidth, h: t.offsetHeight}
        }
        return {w: 0, h: 0}
    };
    var O = function (e) {
        var t = this.getDomNode(e);
        var a = 0;
        if (t) {
            if (t.getComputedStyle) a = t.offsetWidth; else if (window.getComputedStyle) a = parseInt(document.defaultView.getComputedStyle(t, null).getPropertyValue("width"))
        }
        return a
    };
    var I = function (e) {
        var t = this.getDomNode(e);
        var a = 0;
        if (t) {
            if (t.getComputedStyle) a = t.offsetHeight; else if (window.getComputedStyle) a = parseInt(document.defaultView.getComputedStyle(t, null).getPropertyValue("height"))
        }
        return a
    };
    var T = function (e) {
        var t = this.getDomNode(e);
        if (t) {
            return {x: t.offsetLeft, y: t.offsetTop, w: t.offsetWidth, h: t.offsetHeight}
        }
        return {x: 0, y: 0, w: 0, h: 0}
    };
    var P = function (e) {
        var t = cx.dom.body();
        var a = [];
        var n = cx.dom.getDomNode(e);
        var r = {x: 0, y: 0, w: 0, h: 0};
        if (n) {
            r.w = n.offsetWidth;
            r.h = n.offsetHeight;
            while (n) {
                a.push({x: n.offsetLeft, y: n.offsetTop});
                n = n.parentNode;
                if (n == t)break
            }
            for (var i = 0; i < a.length; i++) {
                r.x += a[i].x;
                r.y += a[i].y
            }
        }
        return r
    };
    var k = function (e, t, a) {
        cx.dom.setStyle(e, {left: t + "px", top: a + "px"})
    };
    var _ = function (e, t) {
        var a = this.getDomNode(t);
        if (a) {
            a.style.left = parseInt(this.getWidth(e) / 2 - this.getWidth(a) / 2) + "px"
        }
    };
    var N = function (e, t) {
        var a = this.getDomNode(t);
        if (a) {
            a.style.top = parseInt(this.getHeight(e) / 2 - this.getHeight(a) / 2) + "px"
        }
    };
    var E = function (e) {
        var t = this.getDomNode(e);
        var a;
        if (t) {
            a = t.cloneNode(!1);
            cx.dom.setStyle(a, {
                left: t.offsetLeft + "px",
                top: t.offsetTop + "px",
                width: t.clientWidth + "px",
                height: t.clientHeight + "px"
            });
            a.id = "";
            cx.dom.body().appendChild(a)
        }
        return a
    };
    var j = function (e) {
        var t = [];
        var a = $(e).children();
        for (var n = 0; n < a.length; n++)t.push(a[n]);
        return t
    };
    var L = function (e) {
        var t = this.getDomNode(e);
        if (t) {
            if (t.requestFullscreen) {
                t.requestFullscreen()
            } else if (t.mozRequestFullScreen) {
                t.mozRequestFullScreen()
            } else if (t.msRequestFullscreen) {
                t.msRequestFullscreen()
            } else if (t.webkitRequestFullscreen) {
                t.webkitRequestFullScreen()
            }
        }
    };
    var R = function (e, t) {
        return " " + e + '="' + t + '"'
    };
    var M = function (e) {
        var t, a, n;
        t = $(e).find(".easyui-datebox");
        for (n = 0; n < t.length; n++)$(t[n]).datebox("destroy");
        t = $(e).find(".easyui-combobox");
        for (n = 0; n < t.length; n++)$(t[n]).combobox("destroy");
        t = $(e).find(".easyui-combotree");
        for (n = 0; n < t.length; n++)$(t[n]).combotree("destroy")
    };
    var A = function (e, t, a) {
        var n = cx.dom.getDomNode(e);
        if (a == void 0) {
            return n ? n.getAttribute(t) : null
        } else {
            if (n) n.setAttribute(t, a)
        }
    };
    e.byId = t;
    e.getDomNode = a;
    e.body = n;
    e.enable = r;
    e.getValue = i;
    e.setValue = o;
    e.setInnerHTML = c;
    e.setContent = s;
    e.setVisible = l;
    e.setStyle = d;
    e.setZIndex = u;
    e.bind = f;
    e.empty = v;
    e.create = g;
    e.createNS = h;
    e.append = x;
    e.appendAfter = m;
    e.insertBefore = p;
    e.insertFirst = b;
    e.remove = y;
    e.createCss = w;
    e.setBgColor = C;
    e.getBgColor = D;
    e.getSize = S;
    e.getWidth = O;
    e.getHeight = I;
    e.getPosSize = T;
    e.getPosSizeBody = P;
    e.moveTo = k;
    e.setAlignCenter = _;
    e.setAlignMiddle = N;
    e.clone = E;
    e.getChildren = j;
    e.fullScreen = L;
    e.getKeyVal = R;
    e.clearEasyUi = M;
    e.attr = A;
    return e
}();
cx.domAttr = function () {
    var e = function () {
    };
    var t = function (e, t) {
        var a = cx.dom.getDomNode(e);
        if (!a)return;
        if (t) {
            for (var n in t) {
                a[n] = t[n]
            }
        }
    };
    var a = function (e, t) {
        var a = cx.dom.getDomNode(e);
        if (!a)return;
        delete e[t]
    };
    e.add = t;
    e.remove = a;
    return e
}();
cx.domClass = function () {
    var e = function () {
    };
    var t = function (e, t) {
        var a = cx.dom.getDomNode(e);
        if (!a)return !1;
        return $(a).hasClass(t)
    };
    var a = function (e, t) {
        var a = cx.dom.getDomNode(e);
        if (a) {
            a.className = t
        }
    };
    var n = function (e, t) {
        var a = cx.dom.getDomNode(e);
        if (a) {
            $(a).addClass(t)
        }
    };
    var r = function (e, t) {
        var a = cx.dom.getDomNode(e);
        if (a) {
            $(a).removeClass(t)
        }
    };
    var i = function (e, t, a) {
        var n = cx.dom.getDomNode(e);
        if (n && $(n).hasClass(t)) {
            $(n).removeClass(t);
            $(n).addClass(a)
        }
    };
    var o = function (e, t) {
        var a = cx.dom.getDomNode(e);
        if (a) {
            $(a).toggleClass(t)
        }
    };
    e.has = t;
    e.set = a;
    e.add = n;
    e.remove = r;
    e.replace = i;
    e.toggle = o;
    return e
}();
cx.editor = function () {
    var e = function () {
    };
    var t = function () {
        return {
            viewFile: {
                t: gObj.loc.viewFileTip, c: "iconPreview20", e: function () {
                    var e = this;
                    RunPlugin("SelResItem", {
                        onOk: new Caller(function (t) {
                            e.pasteHTML("&nbsp;&nbsp;" + t.title + '&nbsp;&nbsp;<a class="cx-link zbcxFile fs_15" cmd="view" filename="' + t.filename + '" title="' + t.title + '">' + gObj.loc.viewFileTitle + "</a>&nbsp;")
                        })
                    })
                }
            }, attachFile: {
                t: gObj.loc.attachFileTip, c: "iconDownload20", e: function () {
                    var e = this;
                    RunPlugin("SelResItem", {
                        onOk: new Caller(function (t) {
                            e.pasteHTML("&nbsp;&nbsp;" + t.title + '&nbsp;&nbsp;<a class="cx-link zbcxFile fs_15" cmd="download" filename="' + t.filename + '" title="' + t.title + '">' + gObj.loc.attachFileTitle + "</a>&nbsp;")
                        })
                    })
                }
            }
        }
    };
    var a = function (e) {
        var t = cx.dom.getDomNode(e);
        var a = $(t).find(".zbcxFile");
        for (var r = 0; r < a.length; r++) {
            n(a[r])
        }
    };
    var n = function (e) {
        e.onclick = function () {
            switch ($(e).attr("cmd")) {
                case"view":
                    cx.file.preview($(e).attr("filename"));
                    break;
                case"download":
                    cx.file.saveAs($(e).attr("filename"), $(e).attr("title"));
                    break
            }
        }
    };
    e.getPlugins = t;
    e.parseFile = a;
    return e
}();
cx.file = function () {
    var e = function () {
    };
    var t = function (e, t) {
        var a = gObj.service.getExe("UploadDel");
        var n = {filename: e};
        cx.extend(n, a.getInitPara());
        a.execute(n, t)
    };
    var a = function (e) {
        var t = e.lastIndexOf(".");
        return t > 0 ? e.slice(t + 1, e.length) : ""
    };
    var n = function (e) {
        var t = e.lastIndexOf("/");
        if (t < 0) t = e.lastIndexOf("\\");
        return e.substring(t + 1)
    };
    var r = function (e) {
        return e.slice(0, e.lastIndexOf("."))
    };
    var i = function (e) {
        var t = Math.ceil(e / 1024);
        var a = Math.ceil(t / 1024 * 1e3) / 1e3;
        var n = "";
        if (e >= 1024 * 1024) {
            n += a + " M"
        } else {
            n += t + " K"
        }
        return n
    };
    var o = function (e) {
        return cx.array.indexOf((gObj.syscfg.DocTypes || "").split(","), this.getFileType(e).toUpperCase()) >= 0
    };
    var c = function (e) {
        return cx.array.indexOf((gObj.syscfg.ImgTypes || "").split(","), this.getFileType(e).toUpperCase()) >= 0
    };
    var s = function (e) {
        return cx.array.indexOf((gObj.syscfg.VideoTypes || "").split(","), this.getFileType(e).toUpperCase()) >= 0
    };
    var l = function (e) {
        return cx.array.indexOf((gObj.syscfg.AudioTypes || "").split(","), this.getFileType(e).toUpperCase()) >= 0
    };
    var d = function (e) {
        var t = this.getFileType(e).toUpperCase();
        var a;
        a = cx.array.indexOf((gObj.syscfg.DocTypes || "").split(","), t);
        if (a >= 0)return 1;
        a = cx.array.indexOf((gObj.syscfg.ImgTypes || "").split(","), t);
        if (a >= 0)return 2;
        a = cx.array.indexOf((gObj.syscfg.VideoTypes || "").split(","), t);
        if (a >= 0)return 3;
        a = cx.array.indexOf((gObj.syscfg.AudioTypes || "").split(","), t);
        if (a >= 0)return 4;
        return 0
    };
    var u = function (e) {
        var t = ["\\", "/", ":", "*", "?", '"', "<", ">", "|"];
        var a;
        var n;
        if (!e || e.length < 1)return !1;
        for (n = 0; n < t.length; n++) {
            if (e.indexOf(t[n]) > 0)return !1
        }
        a = e.indexOf(".");
        if (a >= 0) {
            if (a == 0)return !1;
            if (a == e.length - 1)return !1;
            if (a != e.lastIndexOf("."))return !1
        }
        return !0
    };
    var f = function (e) {
        var t = this.type(e);
        var a = this.getFileName(e);
        var n;
        switch (t) {
            case 1:
                n = a + ".swf";
                RunPlugin("FilePreview", {url: n});
                break;
            case 2:
                RunPlugin("PicPreview", {url: e});
                break;
            case 3:
                n = a + ".flv";
                RunPlugin("VideoView", {url: n});
                break;
            case 4:
                RunPlugin("AudioView", {url: e});
                break
        }
    };
    var v = function (e, t) {
        var a = gObj.service.getExe("UploadDld");
        cx.url.openUrl(cx.url.getRequestUrl(a._def.url, {filename: e, saveas: t}))
    };
    var g = function (e) {
        cx.url.openUrl(e)
    };
    e.deleteFile = t;
    e.getFileType = a;
    e.getShortName = n;
    e.getFileName = r;
    e.getFilelenStr = i;
    e.isDoc = o;
    e.isImage = c;
    e.isVideo = s;
    e.isAudio = l;
    e.type = d;
    e.checkFilename = u;
    e.preview = f;
    e.saveAs = v;
    e.download = g;
    return e
}();
cx.fmt = function () {
    var e = function () {
    };
    var t = function (e) {
        var t = "";
        if (e && e != "") {
            for (var a = 0; a < e.length; a++) {
                if (a > 0) t += ",";
                t += e[a]
            }
        }
        return t
    };
    var a = function (e) {
        var t = e;
        if (gObj.syscfg.srsUnit != "m") {
            t = e.clone();
            t.transform("EPSG:" + gObj.syscfg.srsSys, "EPSG:3857")
        }
        var a = Math.round(t.getLength() * 100) / 100;
        var n;
        if (a > 1e3) {
            n = Math.round(a / 1e3 * 100) / 100 + " " + "km"
        } else {
            n = Math.round(a * 100) / 100 + " " + "m"
        }
        return n
    };
    var n = function (e, t) {
        var a = e;
        if (gObj.syscfg.srsUnit != "m") {
            a = e.clone();
            a.transform("EPSG:" + gObj.syscfg.srsSys, "EPSG:3857")
        }
        var n = Math.round(a.getLength() * 100) / 100;
        var r;
        switch (t) {
            case"km":
                r = Math.round(n / 1e3 * 100) / 100;
                break;
            case"m":
                r = Math.round(n * 100) / 100;
                break
        }
        return r
    };
    var r = function (e) {
        var t = e;
        if (gObj.syscfg.srsUnit != "m") {
            t = e.clone();
            t.transform("EPSG:" + gObj.syscfg.srsSys, "EPSG:3857")
        }
        var a = t.getArea();
        var n;
        if (a > 1e6) {
            n = Math.round(a / 1e6 * 100) / 100 + " " + "km<sup>2</sup>"
        } else {
            n = Math.round(a * 100) / 100 + " " + "m<sup>2</sup>"
        }
        return n
    };
    var i = function (e) {
        var t = e;
        if (gObj.syscfg.srsUnit != "m") {
            t = e.clone();
            t.transform("EPSG:" + gObj.syscfg.srsSys, "EPSG:3857")
        }
        var a = Math.round(t.getRadius() * 100) / 100;
        var n;
        if (a > 1e3) {
            n = Math.round(a / 1e3 * 100) / 100 + " " + "km"
        } else {
            n = Math.round(a * 100) / 100 + " " + "m"
        }
        return n
    };
    var o = function (e, t) {
        var a = "000000" + e;
        return a.substr(a.length - t)
    };
    e.arrayToList = t;
    e.formatLength = a;
    e.formatLengthNum = n;
    e.formatArea = r;
    e.formatRadius = i;
    e.formatInt = o;
    return e
}();
cx.ctrl.Layout = function () {
    var e = function (e) {
        var t = this;
        t.target = null;
        t.gutters = !1;
        t.regInfo = null;
        t.sepWest = null;
        t.sepEast = null;
        t.sepNorth = null;
        t.sepSouth = null;
        t.divsWest1 = [];
        t.divsWest2 = [];
        t.divsEast1 = [];
        t.divsEast2 = [];
        t.divsNorth1 = [];
        t.divsNorth2 = [];
        t.divsSouth1 = [];
        t.divsSouth2 = [];
        t.collapsedSize = {}
    };
    var t = function (e) {
        var t = this;
        t.target = e;
        e.wnd = t;
        var a = cx.parser.getOptions($(e).attr("data-options"));
        if (a["split"] === void 0) {
            cx.extend(a, {split: $(e).attr("split")})
        }
        var n = !1;
        if (a["gutters"]) n = !0;
        if (a["fit"]) cx.domClass.add(e, "full_0");
        var r = t.getRegionInfo();
        var i = r.north.div ? r.north.height : 0;
        var o = r.west.div ? r.west.width : 0;
        var c = r.east.div ? r.east.width : 0;
        var s = r.south.div ? r.south.height : 0;
        t.regionPosSize(r, n, o, c, i, s, !0);
        cx.array.append(t.divsWest1, r.west.div);
        cx.array.append(t.divsWest2, r.center.div);
        if (r.west.div && r.west.split) {
            t.sepWest = t.createSep(2, "cx-sep-west")
        }
        cx.array.append(t.divsEast1, r.center.div);
        cx.array.append(t.divsEast2, r.east.div);
        if (r.east.div && r.east.split) {
            t.sepEast = t.createSep(3, "cx-sep-east")
        }
        cx.array.append(t.divsNorth1, r.north.div);
        cx.array.append(t.divsNorth2, r.west.div, r.center.div, r.east.div, t.sepWest, t.sepEast);
        if (r.north.div && r.north.split) {
            t.sepNorth = t.createSep(1, "cx-sep-north")
        }
        cx.array.append(t.divsSouth1, r.west.div, r.center.div, r.east.div, t.sepWest, t.sepEast);
        cx.array.append(t.divsSouth2, r.south.div);
        if (r.south.div && r.south.split) {
            t.sepSouth = t.createSep(4, "cx-sep-south")
        }
        t.sepPosSize(r, n, t.sepWest, t.sepEast, t.sepNorth, t.sepSouth, o, c, i, s, !0);
        t.gutters = n;
        t.regInfo = r
    };
    var a = function () {
        var e, t;
        var a, n, r;
        var i, o, c;
        var s = {
            north: {div: null, width: 0, height: 0, split: !1},
            west: {div: null, width: 0, height: 0, split: !1},
            center: {div: null, width: 0, height: 0, split: !1},
            east: {div: null, width: 0, height: 0, split: !1},
            south: {div: null, width: 0, height: 0, split: !1}
        };
        var l = $(this.target).children("div");
        for (i = 0; i < l.length; i++) {
            a = null;
            n = !1;
            e = cx.parser.getOptions($(l[i]).attr("data-options"));
            if (e["split"] === void 0) {
                t = $(l[i]).attr("split");
                if (t && t == "!0") e.split = !0
            }
            for (o in e) {
                t = e[o];
                switch (o) {
                    case"split":
                        if (t) n = !0;
                        break;
                    case"region":
                        for (c = 0; c < cx.consts.REGIONS.length; c++) {
                            if (t == cx.consts.REGIONS[c]) {
                                a = s[cx.consts.REGIONS[c]]
                            }
                        }
                        break
                }
            }
            if (a) {
                a.div = l[i];
                if (n) a.split = n
            }
        }
        s.center.split = !1;
        for (c = 0; c < cx.consts.REGIONS.length; c++) {
            a = s[cx.consts.REGIONS[c]];
            if (!a || !a.div)continue;
            r = cx.dom.getSize(a.div);
            a.width = r.w;
            a.height = r.h
        }
        return s
    };
    var n = function (e, t) {
        cx.domClass.add(e, "pos_abs");
        if (t) {
            for (var a in t) {
                t[a] = t[a] + "px"
            }
            cx.dom.setStyle(e, t)
        }
    };
    var r = function (e, t) {
        var a = this;
        var n;
        n = cx.dom.create("div", t, a.target, null);
        n.onmousedown = function (t) {
            t.preventDefault();
            n.objSplit = new cx.ctrl.DomSplit(e, n, t.clientX, t.clientY, a);
            n.objSplit.create()
        };
        return n
    };
    var i = function (e, t, a, n, r, i, o) {
        var c = this;
        var s;
        s = e.north.div;
        if (s) {
            c.setPosSize(s, {left: 0, right: 0, top: 0});
            if (o) cx.layout.resize(s, o)
        }
        s = e.south.div;
        if (s) {
            c.setPosSize(s, {left: 0, right: 0, bottom: 0});
            if (o) cx.layout.resize(s, o)
        }
        s = e.west.div;
        if (s) {
            c.setPosSize(s, {
                left: 0,
                top: e.north.div && (e.north.split || t) ? r + cx.layout.SEP : r,
                bottom: e.south.div && (e.south.split || t) ? i + cx.layout.SEP : i
            });
            if (o) cx.layout.resize(s, o)
        }
        s = e.east.div;
        if (s) {
            c.setPosSize(s, {
                right: 0,
                top: e.north.div && (e.north.split || t) ? r + cx.layout.SEP : r,
                bottom: e.south.div && (e.south.split || t) ? i + cx.layout.SEP : i
            });
            if (o) cx.layout.resize(s, o)
        }
        s = e.center.div;
        if (s) {
            c.setPosSize(s, {
                left: e.west.div && (e.west.split || t) ? a + cx.layout.SEP : a,
                right: e.east.div && (e.east.split || t) ? n + cx.layout.SEP : n,
                top: e.north.div && (e.north.split || t) ? r + cx.layout.SEP : r,
                bottom: e.south.div && (e.south.split || t) ? i + cx.layout.SEP : i
            });
            if (o) cx.layout.resize(s, o)
        }
    };
    var o = function (e, t, a) {
        var n = this;
        var r, i;
        var o;
        switch (e) {
            case 1:
                for (o = 0; o < n.divsNorth1.length; o++) {
                    r = n.divsNorth1[o];
                    i = parseInt(r.style.height);
                    r.style.height = i + t + "px";
                    if (a) cx.layout.resize(r, a)
                }
                for (o = 0; o < n.divs2.length; o++) {
                    r = n.divs2[o];
                    i = parseInt(r.style.top);
                    r.style.top = i + t + "px";
                    if (a) cx.layout.resize(r, a)
                }
                break;
            case 4:
                for (o = 0; o < n.divsSouth1.length; o++) {
                    r = n.divsSouth1[o];
                    i = parseInt(r.style.bottom);
                    r.style.bottom = i - t + "px";
                    if (a) cx.layout.resize(r, a)
                }
                for (o = 0; o < n.divsSouth2.length; o++) {
                    r = n.divsSouth2[o];
                    i = parseInt(r.style.height);
                    r.style.height = i - t + "px";
                    if (a) cx.layout.resize(r, a)
                }
                break;
            case 2:
                for (o = 0; o < n.divsWest1.length; o++) {
                    r = n.divsWest1[o];
                    i = parseInt(r.style.width);
                    r.style.width = i + t + "px";
                    if (a) cx.layout.resize(r, a)
                }
                for (o = 0; o < n.divsWest2.length; o++) {
                    r = n.divsWest2[o];
                    i = parseInt(r.style.left);
                    r.style.left = i + t + "px";
                    if (a) cx.layout.resize(r, a)
                }
                break;
            case 3:
                for (o = 0; o < n.divsEast1.length; o++) {
                    r = n.divsEast1[o];
                    i = parseInt(r.style.right);
                    r.style.right = i - t + "px";
                    if (a) cx.layout.resize(r, a)
                }
                for (o = 0; o < n.divsEast2.length; o++) {
                    r = n.divsEast2[o];
                    i = parseInt(r.style.width);
                    r.style.width = i - t + "px";
                    if (a) cx.layout.resize(r, a)
                }
                break
        }
    };
    var c = function (e, t, a, n, r, i, o, c, s, l) {
        var d = this;
        if (a) {
            d.setPosSize(a, {
                width: cx.layout.SEP,
                left: o,
                top: e.north.div && (e.north.split || t) ? s + cx.layout.SEP : s,
                bottom: e.south.div && (e.south.split || t) ? l + cx.layout.SEP : l
            })
        }
        if (n) {
            d.setPosSize(n, {
                width: cx.layout.SEP,
                right: c,
                top: e.north.div && (e.north.split || t) ? s + cx.layout.SEP : s,
                bottom: e.south.div && (e.south.split || t) ? l + cx.layout.SEP : l
            })
        }
        if (r) {
            d.setPosSize(r, {height: cx.layout.SEP, left: 0, right: 0, top: s})
        }
        if (i) {
            d.setPosSize(i, {height: cx.layout.SEP, left: 0, right: 0, bottom: l})
        }
    };
    var s = function () {
        var e = this;
        var t;
        t = e.getRegionInfo(e.target);
        e.regInfo = t;
        var a = t.north.div ? t.north.height : 0;
        var n = t.west.div ? t.west.width : 0;
        var r = t.east.div ? t.east.width : 0;
        var i = t.south.div ? t.south.height : 0;
        e.sepPosSize(t, e.gutters, e.sepWest, e.sepEast, e.sepNorth, e.sepSouth, n, r, a, i, !0)
    };
    var l = function (e) {
        var t, a;
        switch (e) {
            case 1:
                t = this.regInfo.north.div;
                a = cx.dom.getSize(t);
                t.style.height = a.h + "px";
                break;
            case 2:
                t = this.regInfo.west.div;
                a = cx.dom.getSize(t);
                t.style.width = a.w + "px";
                break;
            case 3:
                t = this.regInfo.east.div;
                a = cx.dom.getSize(t);
                t.style.width = a.w + "px";
                break;
            case 4:
                t = this.regInfo.south.div;
                a = cx.dom.getSize(t);
                t.style.height = a.h + "px";
                break
        }
    };
    var d = function (e) {
        return this.regInfo[e].div
    };
    var u = function (e) {
        var t = this;
        var a;
        t.regInfo = t.getRegionInfo(t.target);
        a = t.regInfo;
        var n = a.north.div ? a.north.height : 0;
        var r = a.west.div ? a.west.width : 0;
        var i = a.east.div ? a.east.width : 0;
        var o = a.south.div ? a.south.height : 0;
        t.regionPosSize(a, t.gutters, r, i, n, o, e);
        t.sepPosSize(a, t.gutters, t.sepWest, t.sepEast, t.sepNorth, t.sepSouth, r, i, n, o, e)
    };
    var f = function (e) {
        var t = this;
        var a, n, r;
        if (t.collapsedSize[e] !== void 0)return;
        n = cx.layout.getRegionType(e);
        t.setRegionSizeStyle(n);
        a = t.regInfo[e].div;
        if (a.onCollapse) a.onCollapse();
        r = cx.dom.getSize(a);
        switch (n) {
            case 1:
                t.collapsedSize[e] = r.h;
                t.setRegionSize(n, -r.h, !0);
                break;
            case 2:
                t.collapsedSize[e] = r.w;
                t.setRegionSize(n, -r.w, !0);
                break;
            case 3:
                t.collapsedSize[e] = -r.w;
                t.setRegionSize(n, r.w, !0);
                break;
            case 4:
                t.collapsedSize[e] = -r.h;
                t.setRegionSize(n, r.h, !0);
                break
        }
        t.resetSepPos()
    };
    var v = function (e) {
        var t = this;
        var a, n;
        if (t.collapsedSize[e] === void 0)return;
        n = cx.layout.getRegionType(e);
        a = t.regInfo[e].div;
        if (a.onExpand) a.onExpand();
        t.setRegionSize(n, t.collapsedSize[e], !0);
        delete t.collapsedSize[e];
        t.resetSepPos()
    };
    var g = e.prototype;
    g.create = t;
    g.getRegionInfo = a;
    g.setPosSize = n;
    g.createSep = r;
    g.regionPosSize = i;
    g.setRegionSize = o;
    g.sepPosSize = c;
    g.resetSepPos = s;
    g.setRegionSizeStyle = l;
    g.getRegion = d;
    g.resize = u;
    g.collapse = f;
    g.expand = v;
    return e
}();
cx.ctrl.DomSplit = function () {
    var e = function (e, t, a, n, r) {
        var i = this;
        i.region = e;
        i.sep = t;
        i.mx = a;
        i.my = n;
        i.layout = r;
        i.oldPos = 0;
        switch (e) {
            case 1:
                i.oldPos = parseInt(t.style.top);
                break;
            case 4:
                i.oldPos = parseInt(t.style.bottom);
                break;
            case 2:
                i.oldPos = parseInt(t.style.left);
                break;
            case 3:
                i.oldPos = parseInt(t.style.right);
                break
        }
        i.layout.setRegionSizeStyle(e)
    };
    var t = function () {
        var e = this;
        var t;
        t = "";
        switch (e.region) {
            case 1:
            case 4:
                t = "n-resize";
                break;
            case 2:
            case 3:
                t = "w-resize";
                break
        }
        e.mark = cx.dom.create("div", "cx-dlg-split", cx.dom.body(), {style: "cursor:" + t + ";z-index:" + (cx.nextZIndex() + 1e3)});
        e.mark.onmousemove = function (t) {
            t.preventDefault();
            e.setValSep(t)
        };
        e.mark.onmouseup = function (t) {
            t.preventDefault();
            e.setValSep(t);
            e.setValDivs(t);
            cx.dom.remove(e.mark)
        }
    };
    var a = function (e) {
        var t = this;
        switch (t.region) {
            case 1:
                t.sep.style.top = t.oldPos + (e.clientY - t.my) + "px";
                break;
            case 4:
                t.sep.style.bottom = t.oldPos - (e.clientY - t.my) + "px";
                break;
            case 2:
                t.sep.style.left = t.oldPos + (e.clientX - t.mx) + "px";
                break;
            case 3:
                t.sep.style.right = t.oldPos - (e.clientX - t.mx) + "px";
                break
        }
    };
    var n = function (e) {
        var t = this;
        var a = 0;
        switch (t.region) {
            case 1:
                a = e.clientY - t.my;
                break;
            case 4:
                a = e.clientY - t.my;
                break;
            case 2:
                a = e.clientX - t.mx;
                break;
            case 3:
                a = e.clientX - t.mx;
                break
        }
        t.layout.setRegionSize(t.region, a, !0)
    };
    var r = e.prototype;
    r.create = t;
    r.setValSep = a;
    r.setValDivs = n;
    return e
}();
cx.layout = function () {
    var e = function () {
    };
    e.SEP = 8;
    var t = function (e) {
        for (var t = 0; t < cx.consts.REGIONS.length; t++)if (e == cx.consts.REGIONS[t])return t + 1;
        return 0
    };
    var a = function (e) {
        if (cx.domClass.has(e, "easyui-layout")) {
            $(e).layout("resize", {width: "100%", height: "100%"})
        } else if (cx.domClass.has(e, "easyui-tabs")) {
            $(e).tabs("resize")
        } else if (cx.domClass.has(e, "easyui-datagrid")) {
            $(e).datagrid("resize", {width: "100%", height: "100%"})
        } else if (cx.domClass.has(e, "easyui-datalist")) {
            $(e).datalist("resize", {width: "100%", height: "100%"})
        } else if (cx.domClass.has(e, "easyui-treegrid")) {
            $(e).treegrid("resize", {width: "100%", height: "100%"})
        }
    };
    var n = function (e) {
        var t = this;
        var a = cx.dom.getDomNode(e);
        var n = $(a).children("div");
        if (cx.domClass.has(a, "cx-layout")) {
            var r = new cx.ctrl.Layout;
            r.create(a);
            a.layout = r
        }
        for (var i = 0; i < n.length; i++) {
            t.layout(n[i]);
            t.resizeDijit(n[i])
        }
    };
    var r = function (e, t) {
        var a = this;
        var n = cx.dom.getDomNode(e);
        var r = $(n).children();
        if (cx.domClass.has(n, "cx-layout")) {
            if (n.layout) {
                n.layout.resize(t)
            }
        }
        for (var i = 0; i < r.length; i++) {
            a.resize(r[i], t);
            a.resizeDijit(r[i])
        }
        if (n.onResize) {
            n.onResize()
        }
    };
    e.getRegionType = t;
    e.resizeDijit = a;
    e.layout = n;
    e.resize = r;
    return e
}();
window.addEventListener("resize", function () {
    cx.layout.resize(cx.dom.body(), !1)
}, !1);
cx.load = function () {
    var e = function () {
    };
    var t = function (e) {
        var t = cx.byId(e.idui);
        if (t) {
            t.show();
            return
        }
        var a = {
            id: e.idui,
            title: e.title,
            url: e.url,
            modal: e.modal,
            closable: e.closable,
            alignH: e.alignH,
            alignV: e.alignV !== void 0 ? e.alignV : 0,
            width: e.width,
            height: e.height,
            visible: e.visible !== void 0 ? e.visible : !0,
            icon: e.icon,
            margin: 5,
            noMin: !!e.noMin,
            noClose: !e.closable,
            noSize: !!e.noSize,
            onLoad: e.onLoad,
            onClose: e.onClose,
            onReplaceId: e.onReplaceId
        };
        t = new cx.ctrl.Dialog(a);
        t.create()
    };
    var a = function (e) {
        var t;
        var a;
        t = cx.dom.getDomNode(e.container);
        if (!t)return;
        if (!cx.domClass.has(t, "cx-tabs")) {
            t = cx.dijit.byId(e.container);
            a = cx.dijit.byId(e.idui);
            if (!a.length) {
                t.tabs("add", {
                    id: e.idui,
                    title: e.title,
                    url: e.url,
                    content: gObj.loc.loading,
                    closable: e.closable,
                    selected: e.selected,
                    iconCls: "",
                    onLoad: function (t) {
                        if (e.onLoad) e.onLoad.call()
                    },
                    onDestroy: function () {
                        if (e.onClose) e.onClose.call()
                    }
                });
                cx.ajax.loadText({
                    url: e.url, onLoad: new Caller(function (a) {
                        if (e.onReplaceId) a = e.onReplaceId.call(a);
                        cx.tabs.setContent(t, e.idui, a);
                        if (e.onLoad) e.onLoad.call()
                    })
                })
            } else {
                if (e.selected) {
                    cx.tabs.select(t, a)
                }
            }
        } else {
            a = cx.byId(e.idui);
            if (a) {
                a.getParent().selectChild(a);
                return
            }
            t = cx.byId(e.container);
            a = new cx.ctrl.PageTab({
                id: e.idui,
                title: e.title,
                url: e.url,
                content: gObj.loc.loading,
                closable: e.closable,
                selected: e.selected,
                icon: "",
                onLoad: e.onLoad,
                onClose: e.onClose,
                onReplaceId: e.onReplaceId
            });
            a.create(null, t);
            t.addChild(a, e.selected)
        }
    };
    var n = function (e) {
        var t = cx.byId(e.idui);
        if (t) {
            t.getParent().selectChild(t);
            return
        }
        var a = cx.byId(e.container);
        t = new cx.ctrl.PageFlat({
            id: e.idui,
            title: e.title,
            url: e.url,
            content: gObj.loc.loading,
            closable: e.closable,
            selected: e.selected,
            icon: e.icon,
            onLoad: e.onLoad,
            onClose: e.onClose,
            onReplaceId: e.onReplaceId
        });
        t.create(null, a);
        a.addChild(t, e.selected)
    };
    var r = function (e) {
        cx.ajax.loadHtml({url: e.url, dom: e.container, onLoad: e.onLoad, onReplaceId: e.onReplaceId})
    };
    var i = function (e) {
        var t = null;
        t = cx.dom.getDomNode(e.idui);
        if (t) {
            cx.dom.remove(t)
        }
        var a = "ui-page-theme-" + (gObj.user.theme && gObj.user.theme != "" ? gObj.user.theme : "a");
        t = cx.dom.create("section", "ui-page " + a, "cx-pa" + "ges", {
            "data-role": "page",
            id: e.idui,
            "data-title": e.title,
            "data-theme": "e"
        });
        t.wnd = {
            destroy: function () {
                $(t).off("pageshow")
            }
        };
        var n = function (a) {
            if (e.onReplaceId) a = e.onReplaceId.call(a);
            var n = !1;
            $(t).on("pageshow", function (r, i) {
                if (!n) {
                    cx.dom.setContent(t, a);
                    $(t).trigger("create");
                    var o = $(t).find(".cx-header");
                    if (o.length > 0) {
                        var c = $(t).find("h1");
                        if (c.length > 0) {
                            c[0].innerHTML = e.title
                        }
                    }
                    if (e.onLoad) e.onLoad.call();
                    n = !0
                }
            });
            var r = cx.dom.create("a", "hide", t, {id: "a_" + e.idui, href: "#" + e.idui});
            $(r).click()
        };
        var r = gObj.htmlCache.get(e.url);
        if (r) {
            n(r)
        } else {
            $.ajax({
                type: "POST", url: e.url, dataType: "text", cache: !0, success: n, error: function (e, a, n) {
                    cx.dom.setContent(t, gObj.loc.msgErrInfo)
                }
            })
        }
    };
    var o = function (e) {
        var t = cx.byId(e.idui);
        if (t) {
            t.show();
            return
        }
        var a = {
            id: e.idui,
            url: e.url,
            closable: e.closable,
            alignH: e.alignH,
            alignV: e.alignV !== void 0 ? e.alignV : 0,
            width: e.width,
            height: e.height,
            visible: e.visible !== void 0 ? e.visible : !0,
            onLoad: e.onLoad,
            onClose: e.onClose,
            onReplaceId: e.onReplaceId
        };
        t = new cxm.ctrl.Popup(a);
        t.create()
    };
    var c = function (e) {
        gObj.progressbar = new cx.ctrl.ProgressBar({title: gObj.loc.loading});
        gObj.progressbar.create();
        cx.ajax.post("InitSvr", {cmd: "reload"}, 0, function () {
            if (gObj.progressbar) {
                gObj.progressbar.destroy();
                gObj.progressbar = null
            }
            if (e) {
                e.call()
            }
        })
    };
    var s = function (e) {
        cx.ajax.post("InitSvr", {cmd: "reload"}, 0, function () {
            if (e) {
                e.call()
            }
        })
    };
    e.loadHtml2Dlg = t;
    e.loadHtml2Tab = a;
    e.loadHtml2Flat = n;
    e.loadHtml2Pane = r;
    e.loadHtml2Page = i;
    e.loadHtml2Popup = o;
    e.reloadProg = c;
    e.reload = s;
    return e
}();
cx.msg = function () {
    var e = function () {
    };
    var t = function (e) {
        if (!gObj.dlgMultiMsg) {
            gObj.dlgMultiMsg = new cx.ctrl.DialogMultiMsg({
                title: gObj.loc.titleError,
                msg: gObj.loc.msgErrInfo,
                detail: e.message
            });
            gObj.dlgMultiMsg.init()
        }
        gObj.dlgMultiMsg.add("", e.message)
    };
    var a = function (e) {
        var t = {title: gObj.loc.titleError, msg: e};
        if (cx.isMobile) new cxm.ctrl.MsgBox(t).show(); else new cx.ctrl.DialogMsg(t).init()
    };
    var n = function (e) {
        var t = {title: gObj.loc.titlePrompt, msg: e};
        if (cx.isMobile) new cxm.ctrl.MsgBox(t).show(); else new cx.ctrl.DialogMsg(t).init()
    };
    var r = function (e) {
        var t = {title: gObj.loc.titleError, msg: gObj.loc.get.apply(gObj.loc, arguments)};
        if (cx.isMobile) new cxm.ctrl.MsgBox(t).show(); else new cx.ctrl.DialogMsg(t).init()
    };
    var i = function (e, t, a) {
        if (cx.isMobile) RunPlugin("MsgBoxM", {
            title: gObj.loc.titlePrompt,
            msg: e,
            onOk: t,
            onCancel: a
        }); else new cx.ctrl.DialogConfirm({title: gObj.loc.titlePrompt, msg: e, okCall: t, cancelCall: a}).init()
    };
    e.errorProc = t;
    e.dispError = a;
    e.dispMsg = n;
    e.dispErrCode = r;
    e.confirm = i;
    return e
}();
cx.number = function () {
    var e = function () {
    };
    var t = function (e) {
        if (!e)return !1;
        if (typeof e == "number")return !0;
        return cx.regex.isNumber.test(e)
    };
    var a = function (e) {
        if (typeof e == "number")return e;
        if (this.is(e) != !0)return 0;
        var t = e.indexOf(".");
        if (t >= 0) {
            return parseFloat(e)
        } else {
            return parseInt(e)
        }
    };
    var n = function (e) {
        if (typeof e == "number")return e;
        if (this.is(e) != !0)return "";
        var t = e.indexOf(".");
        if (t >= 0) {
            return parseFloat(e)
        } else {
            return parseInt(e)
        }
    };
    e.is = t;
    e.parse = a;
    e.parse999 = n;
    return e
}();
cx.parser = function () {
    var constructor = function () {
    };
    var getOptions = function (e) {
        var t = {};
        var a, n, r, i;
        var o;
        a = (e || "").split(",");
        for (o = 0; o < a.length; o++) {
            n = a[o].split(":");
            r = n[0];
            i = n[1];
            if (!r || r == "")continue;
            if (i == "true") i = !0; else if (i == "false") i = !1; else {
                if (i.indexOf("'") == 0) i = i.slice(1, i.length - 1); else if (cx.number.is(i)) i = parseFloat(i)
            }
            t[r] = i
        }
        return t
    };
    var getChildren = function (e) {
        var t = [];
        var a = $(e).children();
        for (var n = 0; n < a.length; n++)t.push(a[n]);
        return t
    };
    var parse = function (dom) {
        var cssNames = ["tabs", "tabflat", "sidebar", "filelist", "fold", "scroll", "bubble", "valbutton", "itemlist", "button", "seldeppos", "regionbar"];
        var clssses = ["cx.ctrl.Tabs", "cx.ctrl.TabFlat", "cx.ctrl.SideBar", "cx.ctrl.FileList", "cx.ctrl.Fold", "cxm.ctrl.Scroll", "cx.ctrl.Bubble", "cx.ctrl.ValButton", "cx.ctrl.ItemList", "cx.ctrl.Button", "cx.ctrl.SelDepPos", "cx.ctrl.RegionBar"];
        var divs, obj;
        var i, j;
        for (i = 0; i < cssNames.length; i++) {
            divs = $(dom).find(".cx-" + cssNames[i]);
            for (j = 0; j < divs.length; j++) {
                obj = eval("new " + clssses[i] + "()");
                if (obj) {
                    obj.create(divs[j])
                }
            }
        }
        cx.layout.layout(dom)
    };
    constructor.getOptions = getOptions;
    constructor.getChildren = getChildren;
    constructor.parse = parse;
    return constructor
}();
window.addEventListener("load", function () {
    cx.parser.parse(cx.dom.body())
}, !1);
cx.path = function () {
    var e = function () {
    };
    e.MAPARA = "img/dev/";
    e.EDITOR = "img/editor/";
    e.DevPrt = "img/devPrt/";
    var t = function (e, t) {
        return "icon-" + e + t
    };
    var a = function (e) {
        return "icon-" + e + "16" + " icon-16"
    };
    var n = function (e) {
        return "icon-" + e + "24" + " icon-24"
    };
    var r = function (e) {
        return "icon-" + e + "32" + " icon-32"
    };
    var i = function (e) {
        return "icon-" + e + "64" + " icon-64"
    };
    var o = function (e) {
        return this.MAPARA + e + ".png"
    };
    var c = function (e) {
        return this.EDITOR + e + "16.png"
    };
    var s = function (e) {
        return this.EDITOR + e + "24.png"
    };
    var l = function (e) {
        return this.DevPrt + e + "-prt.png"
    };
    e.getIcon = t;
    e.get16Icon = a;
    e.get24Icon = n;
    e.get32Icon = r;
    e.get64Icon = i;
    e.getMapara = o;
    e.getEditor16 = c;
    e.getEditor24 = s;
    e.getDevPrt = l;
    return e
}();
cx.radio = function () {
    var e = function () {
    };
    var t = function (e) {
        var t = $("input[type=radio][name=" + e + "]");
        for (var a = 0; a < t.length; a++) {
            if (t[a].checked) {
                return t[a].value
            }
        }
        return null
    };
    var a = function (e) {
        var t = $("input[type=radio][name=" + e + "]");
        for (var a = 0; a < t.length; a++) {
            if (t[a].checked) {
                return t[a]
            }
        }
        return null
    };
    var n = function (e, t) {
        var a = $("input[type=radio][name=" + e + "]");
        for (var n = 0; n < a.length; n++) {
            if (a[n].value == t) {
                $(a[n]).attr("checked", "checked")
            }
        }
    };
    e.getChecked = t;
    e.getCheckedRadio = a;
    e.setChecked = n;
    return e
}();
cx.regex = {
    numberAndUnit: /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,
    hex: /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,
    rgb: /rgb\((\d+),(\d+),(\d+)\)/,
    reference: /#([a-z0-9\-_]+)/i,
    matrix: /matrix\(|\)/g,
    matrixElements: /,*\s+|,/,
    whitespace: /\s/g,
    isHex: /^#[a-f0-9]{3,6}$/i,
    isRgb: /^rgb\(/,
    isCss: /[^:]+:[^;]+;?/,
    isBlank: /^(\s+)?$/,
    isNumber: /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
    isPercent: /^-?[\d\.]+%$/,
    isImage: /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,
    negExp: /e\-/gi,
    comma: /,/g,
    hyphen: /\-/g,
    pathLetters: /[MLHVCSQTAZ]/gi,
    isPathLetter: /[MLHVCSQTAZ]/i,
    whitespaces: /\s+/,
    refVariable: /#\{([a-z0-9\-_]+)\}/i,
    X: /X/g
};
cx.select = function () {
    var e = function () {
    };
    var t = function (e, t, a, n, r) {
        var i = cx.dijit.getDijit(e);
        i.combobox({data: t, valueField: a, textField: n, value: r})
    };
    var a = function (e) {
        var t = cx.dijit.byId(e);
        t.combobox({
            filter: function (e, t) {
                var a = $(this).combobox("options");
                return t[a.textField].indexOf(e) == 0
            }
        })
    };
    var n = function (e, t, a, n) {
        var r, i;
        var o;
        r = "";
        for (o = 0; o < e.length; o++) {
            i = !1;
            if (n !== void 0 && n) i = e[o][t] == n ? !0 : !1;
            r += '<option value="' + e[o][t] + '"' + (i ? ' selected="selected"' : "") + ">" + e[o][a] + "</option>"
        }
        return r
    };
    var r = function (e) {
        var t = cx.dijit.byId(e);
        t.empty()
    };
    var i = function (e, t) {
        var a = cx.dijit.byId(e);
        a.prepend('<option value="' + t.value + '">' + t.label + "</option>");
        a.combobox({})
    };
    var o = function (e, t) {
        var a = cx.dijit.byId(e);
        a.append('<option value="' + t.value + '">' + t.label + "</option>");
        a.combobox({})
    };
    var c = function (e) {
        var t = cx.dijit.byId(e);
        var a = "";
        var n = gObj.loc.selectAFld;
        if (t) {
            t.prepend('<option value="' + a + '" selected="selected">' + n + "</option>");
            t.combobox({})
        }
    };
    e.setOpts = t;
    e.setSelectOnly = a;
    e.getOptionStr = n;
    e.removeAllOptions = r;
    e.addFirstOptions = i;
    e.addOptions = o;
    e.addDefOption = c;
    return e
}();
namespace("cx.table");
cx.table = function () {
    var e = function () {
    };
    var t = function (e) {
        var t = cx.dom.getDomNode(e);
        var a;
        var n;
        var r = !0;
        if (t && t.childNodes) {
            for (n = 0; n < t.childNodes.length; n++) {
                a = t.childNodes[n];
                if (a.tagName == "TR" || a.tagName == "tr") {
                    if (r) cx.domClass.toggle(a, "cx-tr-odd"); else cx.domClass.toggle(a, "cx-tr-even");
                    r = !r
                }
            }
        }
    };
    e.setStriped = t;
    return e
}();
cx.tabs = function () {
    var e = function () {
    };
    var t = function (e) {
        var t = cx.byId(e);
        if (!t)return;
        t.getParent().deleteChild(t)
    };
    e.closeTab = t;
    return e
}();
cx.upload = function () {
    var e = function () {
    };
    var t = function (e) {
        switch (cx.file.type(e)) {
            case 1:
                return "swf";
            case 3:
                return "flv"
        }
        return ""
    };
    var a = function (e, t) {
        var a = cx.dijit.getDijit(t.idList);
        var n = {};
        var r = 0;
        var i = cx.dijit.getDijit(e);
        var o = !1;
        if (i.length) {
            i.dmUploader({
                url: t.url, dataType: "json", allowedTypes: "*", extFilter: t.extFilter, onInit: function () {
                }, onNewFile: function (e, r) {
                    if (a && a.length) cx.datagrid.clear(t.idList);
                    n.filename = r.name;
                    n.filelen = cx.file.getFilelenStr(r.size);
                    n.status = "";
                    if (a && a.length) a.datagrid("insertRow", {index: e, row: n});
                    o = !1;
                    var i = cx.dom.getDomNode(t.idPreview);
                    if (i) o = i.checked ? !1 : !0;
                    if (t.idClose) cx.dijit.enable(t.idClose, !1)
                }, onBeforeUpload: function (e) {
                    n.status = gObj.loc.uploading;
                    if (a && a.length) a.datagrid("updateRow", {index: 0, row: n})
                }, onUploadProgress: function (e, t) {
                    n.status = t + "%";
                    if (a && a.length) a.datagrid("updateRow", {index: 0, row: n})
                }, onUploadSuccess: function (e, i) {
                    if (i[0].ret == "1") {
                        alert("");
                        return
                    }
                    r++;
                    n.status = gObj.loc.compeleted;
                    if (a && a.length) a.datagrid("updateRow", {index: 0, row: n});
                    if (t.onlyOne && r > 1) {
                        for (var c in i) {
                            cx.file.deleteFile(i[c].filename, null)
                        }
                    }
                    if (t.onComplete) {
                        i[0].paras = t.paras;
                        i[0].down = o ? 0 : 1;
                        t.onComplete.call(i[0])
                    }
                    if (t.convert) {
                        var s = cx.upload.convertType(i[0].filename);
                        if (s && s != "") {
                            cx.ajax.post("ConvertSvr", {filename: i[0].filename, to: s}, 0, function (e, t) {
                            })
                        }
                    }
                    if (t.idClose) cx.dijit.enable(t.idClose, !0)
                }, onComplete: function () {
                }, onUploadError: function (e, t) {
                    cx.msg.dispError(t)
                }, onFileTypeError: function (e) {
                    cx.msg.dispErrCode("errFileType")
                }, onFileSizeError: function (e) {
                    cx.msg.dispErrCode("errFileLen")
                }, onFileExtError: function (e) {
                    cx.msg.dispErrCode("errFileType")
                }, onFallbackMode: function (e) {
                    cx.msg.dispError(e)
                }
            })
        }
    };
    e.convertType = t;
    e.bind = a;
    return e
}();
cx.url = function () {
    var e = function () {
    };
    var t = function (e, t, a) {
        var n = function (e) {
            var t = typeof e;
            var a = 0;
            var r = "";
            if (t == "number") r = e; else if (t == "string") r = "'" + e + "'"; else if (t == "object" || t == "array") {
                for (var i in e) {
                    a++;
                    r += (a > 1 ? "," : "") + n(e[i])
                }
            }
            return r
        };
        return '<span class="cx-link" onclick="' + e + "(" + n(t) + ')">' + a + "</span>"
    };
    var a = function (e, t) {
        var a = arguments;
        var n = e + "?";
        var r = 0;
        var i, o;
        for (i = 1; i < a.length; i++) {
            if (a[i]) {
                for (o in a[i]) {
                    n += (r > 0 ? "&" : "") + o + "=" + a[i][o];
                    r++
                }
            }
        }
        return n
    };
    var n = function (e) {
        var t = new RegExp("(^|&)" + e + "=([^&]*)(&|$)", "i");
        var a = window.location.search.substr(1).match(t);
        if (a)return a[2];
        return ""
    };
    var r = function (e) {
        window.open(e)
    };
    e.getLinkStr = t;
    e.getRequestUrl = a;
    e.querySearch = n;
    e.openUrl = r;
    return e
}();
cx.util = function () {
    var e = function () {
    };
    var t = function (e, t, a) {
        if (e) {
            e.sort(function (e, n) {
                if (a)return n[t].localeCompare(e[t]); else return e[t].localeCompare(n[t])
            })
        }
    };
    var a = function (e, t, a) {
        if (e) {
            e.sort(function (e, n) {
                if (a)return new Date(n[t]) - new Date(e[t]); else return new Date(e[t]) - new Date(n[t])
            })
        }
    };
    var n = function (e, t, a) {
        if (e) {
            e.sort(function (e, n) {
                if (a)return n[t] - e[t]; else return e[t] - n[t]
            })
        }
    };
    var r = function (e) {
        var t = {};
        for (var a in e)t[a] = e[a];
        return t
    };
    var i = function (e, t) {
        for (var a in e)t[a] = e[a]
    };
    var o = function (e, t) {
        for (var a = 0; a < e.length; a++)t.push(e[a])
    };
    var c = function (e) {
        var t = null;
        if (e instanceof Array) t = []; else if (e instanceof Object) t = {}; else return t;
        for (var a in e) {
            t[a] = typeof e[a] === "object" ? cx.util.deepCopy(e[a]) : e[a]
        }
        return t
    };
    var s = function (e) {
        var t = [];
        var a;
        var n, r;
        for (n in e) {
            a = e[n];
            var i = {};
            for (r in a) {
                i[r] = a[r]
            }
            t[n] = i
        }
        return t
    };
    var l = function (e, t) {
        for (var a in t)if (e[a] !== void 0) delete e[a]
    };
    var d = function (e) {
        if (e instanceof Array) {
            return e.length
        } else if (e instanceof Object) {
            var t = 0;
            for (var a in e) {
                if (e.hasOwnProperty(a)) {
                    t++
                }
            }
            return t
        }
    };
    var u = function (e) {
        var t = e.toString(16);
        return t.length == 1 ? "0" + t : t
    };
    var f = function (e, t, a) {
        var n = [];
        var r, i = 0, o = 0;
        var c = e.length;
        var s;
        if (c > 0) {
            r = parseFloat(e[0][t]);
            i = o = r
        }
        for (s = 1; s < c; s++) {
            r = parseFloat(e[s][t]);
            if (r < i) i = r;
            if (r > o) o = r
        }
        var l = (o - i) / a;
        n[0] = i;
        for (s = 1; s < a; s++) {
            n[s] = n[s - 1] + l
        }
        n[a] = o;
        return n
    };
    e.sortString = t;
    e.sortDate = a;
    e.sortNum = n;
    e.copyObject = r;
    e.copyObjectTo = i;
    e.copyArrayTo = o;
    e.deepCopy = c;
    e.copyArray2 = s;
    e.delAtts = l;
    e.getObjLength = d;
    e.compToHex = u;
    e.partEqual = f;
    return e
}();
namespace("cx.utils");
cx.utils.Math = {
    pntCross: function (e, t) {
        var a = e[0][0] - e[1][0];
        var n = e[0][1] - e[1][1];
        if (Math.abs(a) < 1e-8 && Math.abs(n) < 1e-8) {
            return e[0]
        }
        var r = (t[0] - e[0][0]) * (e[0][0] - e[1][0]) + (t[1] - e[0][1]) * (e[0][1] - e[1][1]);
        r = r / (a * a + n * n);
        return [e[0][0] + r * a, e[0][1] + r * n]
    }, pntCrossBrokenLine: function (e, t) {
        var a = {len: 0};
        var n = 0;
        var r = null;
        for (var i = e.length - 1; i > 0; i--) {
            r = cx.utils.Math.pntCross([e[i], e[i - 1]], t);
            if (r[0] >= e[i][0] && r[0] <= e[i - 1][0] || r[0] <= e[i][0] && r[0] >= e[i - 1][0] || r[1] >= e[i][1] && r[1] <= e[i - 1][1] || r[1] <= e[i][1] && r[1] >= e[i - 1][1]) {
                n = cx.utils.Math.distance2Pnt(t, r);
                if (a.len == 0 || n < a.len) {
                    a.len = n;
                    a.idx = i - 1;
                    a.pntCross = r
                }
            }
        }
        return a
    }, distancePntLin: function (e, t) {
        var a = (e[0][1] - e[1][1]) / (e[0][0] - e[1][0]);
        var n = e[0][1] - a * e[0][1];
        return Math.abs(a * t[0] + n - t[1]) / Math.sqrt(a * a + 1)
    }, distance2Pnt: function (e, t) {
        var a = e[0] - t[0];
        var n = e[1] - t[1];
        return Math.sqrt(a * a + n * n)
    }, radianLine: function (e) {
        var t = 0;
        if (e[1][0] - e[0][0] == 0) {
            t = Math.PI / 2
        } else {
            var a = (e[1][1] - e[0][1]) / (e[1][0] - e[0][0]);
            t = Math.atan(a)
        }
        return t
    }, radian2Line: function (e, t) {
        var a = this.radianLine(e);
        var n = this.radianLine(t);
        return Math.abs(a - n)
    }, radian2Degree: function (e) {
        return e / Math.PI * 180 % 360
    }, degree2Radian: function (e) {
        return e % 360 / 180 * Math.PI
    }, rotateCoor: function (e, t, a) {
        var n = (e[0] - t[0]) * Math.cos(a) - (e[1] - t[1]) * Math.sin(a) + t[0];
        var r = (e[0] - t[0]) * Math.sin(a) + (e[1] - t[1]) * Math.cos(a) + t[1];
        return [n, r]
    }
};
cx.window = function () {
    var e = function () {
    };
    var t = function () {
        var e = {w: 0, h: 0};
        if (window.innerWidth) {
            e.w = window.innerWidth;
            e.h = window.innerHeight
        } else {
            var t = document.documentElement;
            e.w = t.offsetWidth;
            e.h = t.offsetHeight
        }
        return e
    };
    e.getClientSize = t;
    return e
}();
cx.frm.Error = function () {
    var e = function (e) {
        var t = this;
        t.set(e)
    };
    var t = function (e) {
        if (cx.isStr(e)) {
            this.msg = String(e)
        } else if (cx.isObj(e)) {
            if (e.msg) this.msg = String(e.msg);
            if (e.errcode) this.errcode = String(e.errcode);
            if (e.detail) this.detail = String(e.detail)
        }
    };
    var a = function () {
        return this.msg
    };
    var n = function () {
        return this.errCode
    };
    var r = function () {
        return this.detail
    };
    var i = function () {
        alert(this.msg)
    };
    var o = e.prototype;
    o.set = t;
    o.getMsg = a;
    o.getErrCode = n;
    o.getDetail = r;
    o.disp = i;
    return e
}();
cx.frm.Stack = function () {
    var e = function (e) {
        var t = this;
        t.maxSize = 0;
        t.stack = [];
        e = e || {};
        if (e.maxSize) {
            t.maxSize = e.maxSize
        }
    };
    var t = function () {
        this.stack = null
    };
    var a = function () {
        this.stack = []
    };
    var n = function (e) {
        if (this.maxSize > 0) {
            if (this.stack.length >= this.maxSize) {
                this.stack.splice(0, 1)
            }
        }
        this.stack.push(e)
    };
    var r = function () {
        if (this.stack.length > 0) {
            var e = this.stack[this.stack.length - 1];
            this.stack.splice(this.stack.length - 1, 1);
            return e
        }
        return null
    };
    var i = function () {
        if (this.stack.length > 0)return this.stack[this.stack.length - 1];
        return null
    };
    var o = function () {
        return this.stack
    };
    var c = function () {
        return this.stack.length
    };
    var s = e.prototype;
    s.destroy = t;
    s.clear = a;
    s.push = n;
    s.pop = r;
    s.getTop = i;
    s.getAll = o;
    s.size = c;
    return e
}();
cx.frm.PluginBase = function () {
    var constructor = function (e) {
        var t = this;
        t.ready = {data: !1, ui: !1};
        if (e && e.length > 0) {
            t.data = {};
            for (var a = e.length - 1; a >= 0; a--) {
                t.data[e[a]] = null
            }
        }
        t.run = null
    };
    var setInitPara = function (e) {
        if (e) {
            this.initPara = e
        }
    };
    var getInitPara = function () {
        return this.initPara
    };
    var init = function () {
    };
    var destroy = function () {
        this.removeEvent();
        this.freeBase()
    };
    var addEvent = function (e) {
    };
    var removeEvent = function () {
    };
    var isReady = function () {
        return this.ready.data && this.ready.ui
    };
    var readyData = function (e) {
        this.ready.data = !0;
        if (this.isReady()) {
            this.start()
        }
    };
    var readyUi = function () {
        this.ready.ui = !0;
        this.addEvent(this);
        if (this.isReady()) {
            this.start()
        }
    };
    var start = function () {
    };
    var active = function () {
    };
    var unActive = function () {
    };
    var back = function () {
        history.back();
        this.destroySelf()
    };
    var destroySelf = function () {
        var e = this.getDlg();
        if (e && e.destroySelf) {
            e.destroySelf()
        } else {
            gObj.func.destroyRunning(this.run);
            this.run = null
        }
    };
    var resetBase = function () {
        this.ready.ui = !1;
        this.ready.data = !1
    };
    var freeBase = function () {
        var e = this;
        var t;
        var a;
        e.removeEvent();
        if (e.ids) {
            delete e.ids
        }
        if (e.plugin) {
            t = e.plugin;
            for (a in t) {
                t[a] = null
            }
            delete e.plugin
        }
        if (e.data) {
            t = e.data;
            for (a in t) {
                t[a] = null
            }
            delete e.data
        }
        delete e.ready
    };
    var getData = function () {
        return null
    };
    var setData = function (e) {
        var t = this;
        t.ready.data = !0;
        if (t.data === void 0) {
            t.data = {}
        }
        for (var a in e) {
            t.data[a] = e[a]
        }
        if (t.isReady()) {
            t.start()
        }
    };
    var addPlugin = function (e) {
        if (this.plugin === void 0) {
            this.plugin = {}
        }
        this.plugin[e.name] = e.plugin;
        if (e.loadData) {
            e.plugin[e.callName]({}, new Caller(this, "readyData"))
        }
    };
    var getPlugin = function (e) {
        if (this.plugin)return this.plugin[e];
        return null
    };
    var setIds = function (e) {
        if (this.ids === void 0) {
            this.ids = {}
        }
        for (var t in e) {
            this.ids[t] = e[t]
        }
    };
    var replaceId = function (str) {
        var ids = this.ids;
        var id;
        if (ids) {
            for (var i in ids) {
                if (gObj.plugin.isContainerID(ids[i]))continue;
                if (str.indexOf(ids[i]) >= 0) {
                    id = cx.newId();
                    str = str.replace(eval("/\"*'*" + ids[i] + "\"*'*/g"), '"' + id + '"');
                    ids[i] = id
                }
            }
        }
        return str
    };
    var onClose = function () {
    };
    var prototype = constructor.prototype;
    prototype.setInitPara = setInitPara;
    prototype.getInitPara = getInitPara;
    prototype.init = init;
    prototype.destroy = destroy;
    prototype.addEvent = addEvent;
    prototype.removeEvent = removeEvent;
    prototype.isReady = isReady;
    prototype.readyData = readyData;
    prototype.readyUi = readyUi;
    prototype.start = start;
    prototype.active = active;
    prototype.unActive = unActive;
    prototype.back = back;
    prototype.destroySelf = destroySelf;
    prototype.resetBase = resetBase;
    prototype.freeBase = freeBase;
    prototype.getData = getData;
    prototype.setData = setData;
    prototype.addPlugin = addPlugin;
    prototype.getPlugin = getPlugin;
    prototype.setIds = setIds;
    prototype.replaceId = replaceId;
    prototype.onClose = onClose;
    return constructor
}();
cx.frm.AsynchMan = function () {
    var e = function () {
        var e = this;
        cx.base(e, null);
        e.ready.ui = !0;
        e.times = 0;
        e.curTimes = 0;
        e.caller = null
    };
    var t = function (e) {
        this.curTimes++;
        if (this.curTimes >= this.times) {
            this.ready.data = !0;
            this.start()
        }
    };
    var a = function () {
        if (this.caller) {
            this.caller.call()
        }
    };
    var n = function (e, t) {
        var a = this;
        if (a.times != 0)return;
        a.times = e.length;
        a.curTimes = 0;
        a.caller = t;
        var n;
        var r;
        var i;
        for (var o in e) {
            r = e[o];
            n = new Caller(function (e) {
                if (r.onLoad) r.onLoad.call(e);
                a.readyData(e)
            });
            switch (r.type) {
                case 1:
                    cx.ajax.loadJs({url: r.url, className: null, onLoad: n});
                    break;
                case 2:
                    cx.ajax.loadCss({url: r.url, onLoad: n});
                    break;
                case 3:
                    cx.ajax.loadText({url: r.url, onLoad: n});
                    break;
                case 4: {
                    i = gObj.service.getExe(r.url);
                    i.checkData(r.options, n)
                }
                    break;
                case 5: {
                    i = gObj.service.getExe(r.url);
                    i.loadData(r.options, n)
                }
                    break
            }
        }
    };
    cx.inherits(e, cx.frm.PluginBase);
    var r = e.prototype;
    r.readyData = t;
    r.start = a;
    r.setIntents = n;
    return e
}();
cx.frm.Localization = function () {
    var e = function () {
        var e = this;
        cx.base(e, null);
        e.ready.ui = !0;
        e.baseDir = "locale/"
    };
    var t = function (e) {
        this.baseDir = e
    };
    var a = function (e, t) {
        var a = this;
        var n = [];
        var r;
        for (var i in e) {
            r = {};
            r.type = 3;
            r.url = this.baseDir + (gLoc ? "zh_CN/" : "en_US/") + e[i];
            r.onLoad = new Caller(function (e) {
                var t = e.split("\r\n");
                var n, r, i, o;
                for (var c = 0; c < t.length; c++) {
                    n = t[c].trim();
                    r = n.indexOf("=");
                    if (r < 0)continue;
                    i = n.substring(0, r);
                    o = n.substring(r + 1);
                    a[i] = o
                }
            });
            n.push(r)
        }
        var o = new cx.frm.AsynchMan;
        o.setIntents(n, t)
    };
    var n = function (e, t) {
        var a;
        a = this[e];
        if (!a)return null;
        for (i = 1; i < arguments.length; i++) {
            a = a.replace("%" + i, "" + arguments[i])
        }
        return a
    };
    cx.inherits(e, cx.frm.PluginBase);
    var r = e.prototype;
    r.setDir = t;
    r.load = a;
    r.get = n;
    return e
}();
gObj.loc = new cx.frm.Localization;
cx.frm.Running = function () {
    var constructor = function (e, t, a) {
        var n = this;
        cx.base(n, null);
        n.id = e;
        n.pluginDef = t;
        n.dataName = a;
        n.uiOption = null;
        n.plugin = null
    };
    var destroy = function () {
        if (this.plugin) {
            this.plugin.destroy();
            this.plugin = null
        }
        this.uiOption = null;
        this.dataName = null;
        this.pluginDef = null;
        cx.base(this, "destroy")
    };
    var readyData = function (data) {
        var self = this;
        var pDef = self.pluginDef;
        if (pDef.prereq != "") {
            var plug = gObj.func.findPluginName(pDef.prereq);
            if (!plug || plug.isReady() != !0) {
                setTimeout(function () {
                    self.readyData(null)
                }, 100);
                return
            }
        }
        self.plugin = eval("new " + pDef.plugin + "()");
        var plugin = self.plugin;
        if (plugin) {
            plugin.run = self;
            if (pDef.autoobj != "") {
                var np = window;
                var strs = pDef.autoobj.split(".");
                for (var i = 0; i < strs.length - 1; i++) {
                    if (i == 0 && strs[0] == "gObj") {
                        np = gObj
                    } else {
                        np[strs[i]] = {};
                        np = np[strs[i]]
                    }
                }
                np[strs[i]] = plugin
            }
            if (pDef.service != "") {
                var exes = gObj.service.getExes(pDef.service);
                exes.setReadyCall(new Caller(plugin, "readyData"));
                exes.init();
                plugin.addPlugin({name: "exes", plugin: exes, loadData: !1, callName: "checkData"});
                plugin.getExes = function () {
                    return exes
                }
            }
            if (pDef.initpara) {
                plugin.setInitPara(pDef.initpara)
            }
            plugin.init();
            if (plugin.plugin === void 0) {
                plugin.readyData(null)
            }
            self.uiOption = {
                idui: pDef.idui,
                url: gObj.plugin.getPath(pDef.dir, gLoc ? pDef.uiurlc : pDef.uiurle),
                title: gLoc ? pDef.titlec : pDef.titlee,
                runn: !!pDef.runn,
                uiType: pDef.uitype,
                container: pDef.container,
                modal: !!pDef.modal,
                closable: !!pDef.closeable,
                alignH: pDef.align,
                width: pDef.width,
                height: pDef.height,
                icon: pDef.iconClass,
                onLoad: new Caller(plugin, "readyUi"),
                onClose: new Caller(self, "onClose"),
                onReplaceId: new Caller(plugin, "replaceId"),
                selected: !0
            };
            if (pDef.initpara) {
                var ip = pDef.initpara;
                if (ip.widthDlg !== void 0) self.uiOption.width = ip.widthDlg;
                if (ip.heightDlg !== void 0) self.uiOption.height = ip.heightDlg;
                if (ip.alignV !== void 0) self.uiOption.alignV = ip.alignV;
                if (ip.visible !== void 0) self.uiOption.visible = ip.visible;
                if (ip.selected !== void 0) self.uiOption.selected = ip.selected;
                if (ip.noSize !== void 0) self.uiOption.noSize = ip.noSize
            }
            plugin.getIdUi = function () {
                return pDef.idui
            };
            plugin.getDlg = function () {
                switch (pDef.uitype) {
                    case 1:
                    case 2:
                    case 4:
                    case 5:
                    case 6:
                        return cx.byId(pDef.idui);
                    default:
                        return null
                }
            };
            plugin.setTitle = function (e) {
                switch (pDef.uitype) {
                    case 1:
                        this.getDlg().setTitle(e);
                        break;
                    case 2:
                        this.getDlg().setTitle(e);
                        break;
                    case 5:
                        var t = $(cx.dom.byId(pDef.idui)).find("div[data-role=header] h1");
                        if (t.length > 0) cx.dom.setInnerHTML(t[0], e);
                        break;
                    case 3:
                    case 6:
                        break
                }
            };
            self.showUi()
        }
    };
    var onClose = function (e) {
        if (e && this.plugin) {
            this.plugin.onClose(e)
        }
        gObj.func.destroyRunning(this)
    };
    var showUi = function () {
        var e = this.uiOption;
        if (e) {
            if (e.url == "") {
                this.plugin.readyUi()
            } else {
                var t = e.uiType;
                switch (t) {
                    case 1:
                        cx.load.loadHtml2Dlg(e);
                        break;
                    case 2:
                        cx.load.loadHtml2Tab(e);
                        break;
                    case 3:
                        cx.load.loadHtml2Pane(e);
                        break;
                    case 4:
                        cx.load.loadHtml2Flat(e);
                        break;
                    case 5:
                        cx.load.loadHtml2Page(e);
                        break;
                    case 6:
                        cx.load.loadHtml2Popup(e);
                        break;
                    default:
                        this.plugin.readyUi();
                        break
                }
            }
        }
    };
    cx.inherits(constructor, cx.frm.PluginBase);
    var prototype = constructor.prototype;
    prototype.destroy = destroy;
    prototype.readyData = readyData;
    prototype.onClose = onClose;
    prototype.showUi = showUi;
    return constructor
}();
cx.frm.Observer = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["list"]);
        e.ready.ui = !0;
        e.ready.data = !0;
        e.data.list = []
    };
    var t = function (e, t, a, n) {
        this.data.list.push({id: e, dataType: t, caller: a, obsTar: n})
    };
    var a = function (e, t, a) {
        var n = {id: e};
        if (t) n.obsTar = t;
        if (a) n.dataType = a;
        cx.array.remove(this.data.list, n)
    };
    var n = function (e, t, a) {
        var n = cx.array.gets(this.data.list, {dataType: e});
        var r;
        t = t || {};
        t.obsTar = a;
        for (var i in n) {
            if (!n[i].obsTar || n[i].obsTar && n[i].obsTar == a) {
                r = n[i].caller;
                if (typeof r == "function") r(t); else if (r) r.call(t)
            }
        }
    };
    var r = function (e, t, a, n) {
        this.subscribe(e, t, a, n)
    };
    var i = function (e, t, a) {
        this.unsubscribe(e, t, a)
    };
    cx.inherits(e, cx.frm.PluginBase);
    var o = e.prototype;
    o.subscribe = t;
    o.unsubscribe = a;
    o.publish = n;
    o.listen = r;
    o.unlisten = i;
    return e
}();
gObj.observer = new cx.frm.Observer;
cx.frm.Entity = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["load"]);
        e.ready.ui = !0;
        e.oEtty_ = {}
    };
    var t = function () {
        c.call(this)
    };
    var a = function () {
        return this.data.load
    };
    var n = function (e) {
        return cx.array.get1(this.data.load, {name: e})
    };
    var r = function (e) {
        return cx.array.get1(this.data.load, {tabatt: e})
    };
    var i = function (e) {
        return this.oEtty_[e]
    };
    var o = function (e, t) {
        var a = this.oEtty_[e];
        if (cx.isObj(a))return a[t]
    };
    var c = function () {
        var e, t;
        var a = this.data.load;
        for (var n = 0, r = a.length; n < r; n++) {
            e = a[n].major;
            t = a[n].minor;
            this.oEtty_[e] = this.oEtty_[e] || {};
            this.oEtty_[e][t] = a[n]
        }
    };
    cx.inherits(e, cx.frm.PluginBase);
    var s = e.prototype;
    s.start = t;
    s.getAll = a;
    s.byName = n;
    s.byTabAtt = r;
    s.byMajor = i;
    s.byMajorMinor = o;
    return e
}();
cx.frm.Field = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["fld", "fldvalue"]);
        e.ready.ui = !0;
        e.fld = {};
        e.fldValue = {}
    };
    var t = function () {
        var e = this;
        var t, a;
        var n;
        for (n in e.data.fld) {
            t = e.data.fld[n].tabname;
            if (e.fld[t] === void 0) e.fld[t] = [];
            e.fld[t].push(e.data.fld[n])
        }
        for (n in e.data.fldvalue) {
            t = e.data.fldvalue[n].tabname;
            a = e.data.fldvalue[n].colname;
            if (e.fldValue[t] === void 0) e.fldValue[t] = {};
            if (e.fldValue[t][a] === void 0) e.fldValue[t][a] = [];
            e.fldValue[t][a].push(e.data.fldvalue[n])
        }
        e.data.fld = null;
        e.data.fldvalue = null
    };
    var a = function (e) {
        if (this.fld[e] !== void 0)return this.fld[e]; else return []
    };
    var n = function (e) {
        return cx.array.gets(this.getFlds(e), {isnum: 1})
    };
    var r = function (e, t) {
        if (this.fldValue[e] !== void 0) {
            if (this.fldValue[e][t] !== void 0)return this.fldValue[e][t]; else return []
        } else {
            return []
        }
    };
    cx.inherits(e, cx.frm.PluginBase);
    var i = e.prototype;
    i.start = t;
    i.getFlds = a;
    i.getFldsNum = n;
    i.getFldvalues = r;
    return e
}();
cx.frm.FieldCfg = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["fldcfg"]);
        e.ready.ui = !0
    };
    var t = function (e, t) {
        var a = {};
        if (e) a.plugin = e;
        if (t) a.func = t;
        return cx.array.gets(this.data.fldcfg, a)
    };
    cx.inherits(e, cx.frm.PluginBase);
    var a = e.prototype;
    a.get = t;
    return e
}();
cx.frm.FormAtt = function () {
    var constructor = function () {
    };
    var checkInput = function (e, t, a) {
        if (!t || t == "") {
            var n;
            if (e instanceof cx.ctrl.ValButton) n = cx.parser.getOptions($(e.target).attr("data-options")); else n = cx.parser.getOptions(e.attr("data-options"));
            if (n.required) {
                var r = e.attr("placeholder") || a;
                cx.msg.dispErrCode("errFldNodata", r);
                return !1
            }
        }
        return !0
    };
    var getIdValues = function (e, t, a) {
        var n = cx.dom.getDomNode(e);
        var r, i, o, c;
        var s;
        r = $(n).find(".cx-valbutton");
        for (s = 0; s < r.length; s++) {
            o = r[s].id;
            if (!o || o == "")continue;
            i = r[s].wnd;
            c = i.val();
            if (!this.checkInput(i, c, o))return !1;
            t["FK_" + o] = c
        }
        r = $(n).find(".easyui-textbox");
        for (s = 0; s < r.length; s++) {
            o = r[s].id;
            if (!o || o == "")continue;
            i = $(r[s]);
            c = i.val();
            if (!this.checkInput(i, c, o))return !1;
            t["FK_" + o] = c
        }
        r = $(n).find(".easyui-datebox");
        for (s = 0; s < r.length; s++) {
            o = r[s].id;
            if (!o || o == "")continue;
            i = $(r[s]);
            c = i.datebox("getValue");
            if (!this.checkInput(i, c, o))return !1;
            t["FK_" + o] = c
        }
        r = $(n).find(".easyui-combobox");
        for (s = 0; s < r.length; s++) {
            o = r[s].id;
            if (!o || o == "")continue;
            i = $(r[s]);
            c = i.combobox("getValue");
            if (!this.checkInput(i, c, o))return !1;
            t["FK_" + o] = c
        }
        if (a) {
            t["FK_applyUserName"] = gObj.user.name
        }
        if (!a) {
            if (t["FK_COMMENT_"] != void 0) {
                if (t["FK_COMMENT_"] != "") {
                    t["COMMENT_"] = gObj.user.name + "@:" + t.FK_COMMENT_
                }
                delete t.FK_COMMENT_
            }
        }
        return !0
    };
    var replaceVariables = function (strHtml, att) {
        if (att) {
            var reg;
            for (var i in att) {
                reg = eval("/\\$\\{" + i + "\\}/g");
                strHtml = strHtml.replace(reg, att[i])
            }
        }
        return strHtml
    };
    var getValue = function (e) {
        var t;
        t = cx.byId(e);
        if (t)return t.val();
        t = cx.dijit.getDijit(e);
        if (t)return cx.dijit.getValue(t);
        t = cx.dom.getDomNode(e);
        if (t)return cx.dom.getValue(t)
    };
    constructor.checkInput = checkInput;
    constructor.getIdValues = getIdValues;
    constructor.replaceVariables = replaceVariables;
    constructor.getValue = getValue;
    return constructor
}();
cx.frm.Func = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["group", "func"]);
        e.ready.ui = !0;
        e.runings = [];
        e.execId = -1
    };
    var t = function () {
        for (var e in this.runings) {
            this.runings[e].destroy();
            this.runings[e] = null
        }
        this.runings = null;
        cx.base(this, "destroy")
    };
    var a = function (e) {
        return cx.array.gets(this.data.func, {grp: e})
    };
    var n = function (e) {
        var t, a, n;
        t = cx.array.get1(this.data.func, {id: e});
        if (!t)return null;
        a = gObj.plugin.byName(t.plugin);
        if (!a)return null;
        n = cx.array.get1(this.runings, {id: a.id});
        if (n && !n.plugin) {
            cx.array.remove(this.runings, {id: e});
            n.destroy();
            n = null
        }
        if (!n) {
            var r = {};
            cx.extend(r, a);
            r.initpara = {};
            cx.extend(r.initpara, a.initpara);
            n = new cx.frm.Running(r.runn ? this.execId-- : r.id, r, null);
            this.runings.push(n);
            if (cx.debug) cx.ajax.loadJs({
                className: r.plugin,
                url: gObj.plugin.getPath(r.dir, r.classurl),
                onLoad: new Caller(n, "readyData")
            }); else cx.ajax.loadClass({
                className: r.plugin,
                url: gObj.plugin.getPath(r.dir, r.classurl),
                onLoad: new Caller(n, "readyData")
            })
        } else {
            n.showUi()
        }
        return n
    };
    var r = function (e) {
        var t = this.runings;
        var a;
        if (e.runn != 0) {
            e.idui = e.idui + cx.newId()
        } else {
            if (cx.dom.byId(e.idui)) {
                for (a in t) {
                    if (t[a].pluginDef.idui == e.idui) {
                        t[a].showUi();
                        return t[a]
                    }
                }
            }
            for (a = t.length - 1; a >= 0; a--) {
                if (t[a].pluginDef.name == e.name) {
                    this.destroyRunning(t[a])
                }
            }
        }
        var n = new cx.frm.Running(e.runn ? this.execId-- : e.id, e, null);
        t.push(n);
        if (cx.debug) cx.ajax.loadJs({
            className: e.plugin,
            url: gObj.plugin.getPath(e.dir, e.classurl),
            onLoad: new Caller(n, "readyData")
        }); else cx.ajax.loadClass({
            className: e.plugin,
            url: gObj.plugin.getPath(e.dir, e.classurl),
            onLoad: new Caller(n, "readyData")
        });
        return n
    };
    var i = function (e, t) {
        var a = cx.array.get1(gObj.plugin.data.plugin, {name: e});
        if (a) {
            var n = {};
            cx.extend(n, a);
            n.initpara = {};
            cx.extend(n.initpara, a.initpara, t);
            return this.execPlugin(n)
        }
        return null
    };
    var o = function () {
        var e = cx.array.gets(gObj.plugin.data.plugin, {autorun: 1});
        for (var t = e.length - 1; t >= 0; t--) {
            this.execPlugin(e[t])
        }
    };
    var c = function (e, t) {
        if (e) {
            var a = this.runings;
            var n;
            for (n in a) {
                if (a[n] == e) {
                    if (e.plugin) {
                        e.plugin.destroy();
                        if (t) {
                            var r = e.plugin.getIdUi();
                            if (r) {
                                var i = cx.byId(r);
                                if (i && i.destroySelf) {
                                    i.destroySelf()
                                }
                            }
                        }
                        e.plugin = null
                    }
                    a[n].destroy();
                    a[n] = null;
                    a.splice(n, 1);
                    break
                }
            }
        }
    };
    var s = function (e) {
        var t = this.runings;
        var a;
        for (var n in t) {
            a = t[n];
            if (a.plugin && a.pluginDef.name == e) {
                return a.plugin
            }
        }
        return null
    };
    var l = function (e) {
        var t = this.runings;
        var a;
        for (var n in t) {
            a = t[n];
            if (a.plugin) {
                if (a.plugin instanceof e) {
                    return a.plugin
                }
            }
        }
        return null
    };
    var d = function (e) {
        var t = this.runings;
        var a;
        for (var n in t) {
            a = t[n];
            if (a.plugin && a.pluginDef.name == e) {
                return a
            }
        }
        return null
    };
    cx.inherits(e, cx.frm.PluginBase);
    var u = e.prototype;
    u.destroy = t;
    u.getFuncsByGrpName = a;
    u.execFunc = n;
    u.execPlugin = r;
    u.runPlugin = i;
    u.runAuto = o;
    u.destroyRunning = c;
    u.findPluginName = s;
    u.findPluginType = l;
    u.findPluginRun = d;
    return e
}();
function CallFunc(e) {
    return gObj.func.execFunc(e)
}
function CallPlugin(e) {
    return gObj.func.runPlugin(e, null)
}
function RunPlugin(e, t) {
    return gObj.func.runPlugin(e, t)
}
cx.frm.IAccess = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["load"]);
        e.ready.ui = !0;
        e.viewMenu = {func: {}, funcGrp: {}};
        e.dataSrc = null;
        e.access = {};
        e.types = {func: 1, ettCatView: 2, ettCatEdit: 3, region: 4}
    };
    var t = function () {
        var e = cx.array.get1(gObj.init.syscfg, {keyno: "superAdmin"});
        if (e.value && e.value[gObj.init.user.sys] && e.value[gObj.init.user.sys].types) this.types = e.value[gObj.init.user.sys].types;
        this.dataSrc = this.data.load.obj;
        this.preEttCatEdit();
        this.preEttCatView();
        this.preEttEdit();
        this.preEttView();
        this.preRegion();
        this.preFunc();
        this.preMenuView()
    };
    var a = function (e, t, a) {
        if (!gObj.layer.getMajors()[e])return !0;
        if (this.access[this.types.ettEdit])return this.access[this.types.ettEdit][e + "_" + t + "_" + a];
        return !0
    };
    var n = function (e, t) {
        if (!gObj.layer.getMajors()[e])return !0;
        if (this.access[this.types.ettCatEdit])return this.access[this.types.ettCatEdit][e + "_" + t];
        return !0
    };
    var r = function (e, t, a, n) {
        var r = !1;
        if (this.canUseRegion(n.reg) && this.canEditEttCat(e, t) && this.canEditEtt(e, t, a)) r = !0;
        return r
    };
    var i = function (e, t, a) {
        return !0
    };
    var o = function (e, t) {
        if (!gObj.layer.getMajors()[e])return !0;
        if (this.access[this.types.ettCatView])return this.access[this.types.ettCatView][e + "_" + t];
        return !0
    };
    var c = function (e, t, a, n) {
        var r = !1;
        if (this.canUseRegion(n.reg) && this.canViewEttCat(e, t) && this.canViewEtt(e, t, a)) r = !0;
        return r
    };
    var s = function (e) {
        if (this.access[this.types.func])return this.access[this.types.func][e];
        return !0
    };
    var l = function (e) {
        if (this.access[this.types.region])return this.access[this.types.region][e];
        return !0
    };
    var d = function () {
        var e = [];
        var t = this.access[this.types.region];
        for (var a in t) {
            e.push(a)
        }
        return e
    };
    var u = function (e) {
        var t = !1;
        if (e.no == "admin") t = !0;
        return t
    };
    var f = function (e) {
        var t = !1;
        if (e.plugin && this.viewMenu.func[e.plugin] || e.name && e.target && this.viewMenu.funcGrp[e.name]) {
            t = !0
        }
        return t
    };
    var v = function () {
        var e = this.dataSrc[this.types.ettCatEdit];
        if (cx.isArr(e)) {
            var t = this.access[this.types.ettCatEdit] = {};
            for (var a = e.length - 1; a >= 0; a--) {
                t[e[a].major + "_" + e[a].minor] = !0
            }
        }
    };
    var g = function () {
        var e = this.dataSrc[this.types.ettCatView];
        if (cx.isArr(e)) {
            var t = this.access[this.types.ettCatView] = {};
            for (var a = e.length - 1; a >= 0; a--) {
                t[e[a].major + "_" + e[a].minor] = !0
            }
        }
    };
    var h = function () {
    };
    var x = function () {
    };
    var m = function () {
        var e = this.dataSrc[this.types.func];
        if (cx.isArr(e)) {
            var t = this.access[this.types.func] = {};
            for (var a = e.length - 1; a >= 0; a--) {
                t[e[a].objectid] = !0
            }
        }
        if (this.isSuperAdmin(gObj.init.user) && gObj.syscfg.superAdmin && gObj.syscfg.superAdmin[gObj.init.user.sys]) {
            var n = gObj.syscfg.superAdmin[gObj.init.user.sys];
            for (var a = n.plugin.length - 1; a >= 0; a--)t[n.plugin[a]] = !0
        }
    };
    var p = function () {
        var e = gObj.init.func;
        for (var t = e.length - 1; t >= 0; t--) {
            if (e[t].grp.indexOf("QX") < 0 && this.canUseFunc(e[t].plugin) && cx.array.get1(gObj.init.plugin, {name: e[t].plugin})) {
                this.viewMenu.func[e[t].plugin] = !0;
                this.preMenuViewGrp({name: e[t].grp})
            }
        }
    };
    var b = function (e) {
        var t = cx.array.get1(gObj.init.funcgrp, e);
        if (t) {
            this.viewMenu.funcGrp[t.name] = !0;
            this.preMenuViewGrp({name: t.glgrp})
        }
    };
    var y = function () {
        var e = this.dataSrc[this.types.region];
        if (cx.isArr(e)) {
            var t = this.access[this.types.region] = {};
            for (var a = e.length - 1; a >= 0; a--) {
                t[e[a].objectid] = !0
            }
        }
    };
    cx.inherits(e, cx.frm.PluginBase);
    var w = e.prototype;
    w.start = t;
    w.canEditEtt = a;
    w.canEditEttCat = n;
    w.canEditFea = r;
    w.canViewEtt = i;
    w.canViewEttCat = o;
    w.canViewFea = c;
    w.canUseFunc = s;
    w.canUseRegion = l;
    w.getUserRegions = d;
    w.isSuperAdmin = u;
    w.isViewMenu = f;
    w.preEttCatEdit = v;
    w.preEttCatView = g;
    w.preEttEdit = h;
    w.preEttView = x;
    w.preFunc = m;
    w.preMenuView = p;
    w.preMenuViewGrp = b;
    w.preRegion = y;
    return e
}();
cx.frm.Plugin = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["plugin"]);
        e.conntains = [];
        e.ready.ui = !0
    };
    var t = function () {
        this.conntains = null
    };
    var a = function () {
        var e = [16, 24, 32];
        var t = this.data.plugin;
        var a, n;
        var r, i, o;
        var c = "";
        for (i in t) {
            a = t[i];
            n = a.container;
            if (n && n != "") {
                if (!cx.array.has(this.conntains, n)) {
                    this.conntains.push(n)
                }
            }
            n = a.initpara;
            if (n) {
                if (n == "") a.initpara = null
            }
            a.iconClass = null;
            n = a.icon;
            if (!n || n == "") {
                a.iconClass = "plugin"
            } else {
                r = n.indexOf(".");
                if (r == 0) {
                    a.iconClass = n.substring(1)
                } else if (r < 0) {
                    a.iconClass = n;
                    for (o = 0; o < e.length; o++) {
                        c = c + ".icon-" + a.iconClass + e[o] + "{background-image:url(" + a.dir + n + e[o] + ".png)} "
                    }
                }
            }
        }
        if (c != "") {
            cx.dom.createCss(c)
        }
    };
    var n = function (e) {
        return cx.array.get1(this.data.plugin, {name: e})
    };
    var r = function (e, t) {
        if (!t || t == "")return t;
        if (t.indexOf("/") >= 0)return t;
        return e + t
    };
    var i = function (e, t, a) {
        if (!t || t == "")return "";
        var n;
        var r = t.indexOf(".");
        if (r == 0) {
            n = "icon-" + t.substring(1) + a;
            return n
        } else if (r > 0) {
            n = "icon-" + t.substring(0, r);
            cx.dom.createCss("." + n + "{background-image:url(" + e + t + ")}");
            return n
        } else {
            n = "icon-" + t + a;
            cx.dom.createCss("." + n + "{background-image:url(" + e + t + a + ".png)}");
            return n
        }
        return ""
    };
    var o = function (e) {
        return cx.array.has(this.conntains, e)
    };
    cx.inherits(e, cx.frm.PluginBase);
    var c = e.prototype;
    c.destroy = t;
    c.start = a;
    c.byName = n;
    c.getPath = r;
    c.getIconCls = i;
    c.isContainerID = o;
    return e
}();
cx.frm.AttBase = function () {
    var e = function (e) {
        var t = this;
        e = e || {};
        t._tabname = e.tabname;
        t.domNode = e.domNode;
        t.att = e.att !== void 0 ? e.att : null;
        t._editable = e.editable !== void 0 ? e.editable : !1;
        t._needOper = e.needOper !== void 0 ? e.needOper : !1;
        t._changeCaller = e.changeCaller;
        t._noLimit = e.noLimit !== void 0 ? e.noLimit : !1;
        t.widthKey = e.widthKey !== void 0 ? e.widthKey : null;
        t._widthVal = e.widthVal !== void 0 ? e.widthVal : null;
        t.flds = e.flds !== void 0 ? e.flds : null;
        t._selOpts = [];
        t._observers = [];
        t._doms = [];
        t._isNew = !0;
        t._dispCols = e.dispCols !== void 0 ? e.dispCols : 1;
        if (cx.isMobile) {
            t.idpre = cx.newId()
        }
    };
    var t = function () {
        var e = this;
        var t = gObj.entity.byTabAtt(e._tabname);
        if (!e.flds) e.flds = gObj.field.getFlds(e._tabname);
        e._isNew = !e.att ? !0 : !1;
        if (t) {
            if (e.widthKey && t.keywid && t.keywid != "") {
                e.widthKey = t.keywid
            }
        }
        if (e._isNew) {
            e.att = e.getDefVal()
        }
        if (e.initAtt) {
            e.initAtt(e.att, e._isNew, e)
        }
    };
    var a = function () {
        var e = {};
        var t;
        var a;
        for (a = 0; a < this.flds.length; a++) {
            t = this.flds[a];
            e[t.colname] = "";
            if (t.defval != "") {
                if (t.isnum != 0) e[t.colname] = cx.number.parse(t.defval); else e[t.colname] = t.defval
            } else {
                if (t.isnum != 0) e[t.colname] = 0
            }
        }
        return e
    };
    var n = function () {
        var e = {};
        var t;
        var a;
        for (a = 0; a < this.flds.length; a++) {
            t = this.flds[a];
            e[t.colname] = "";
            if (t.defval != "") {
                if (t.isnum != 0) e[t.colname] = cx.number.parse(t.defval); else e[t.colname] = t.defval
            }
        }
        return e
    };
    var r = function () {
        var e = {};
        var t, a;
        var n;
        for (n = 0; n < this.flds.length; n++) {
            t = this.flds[n];
            if (t.disporder < 1)continue;
            a = this.getFldValue(t.colname);
            e[t.colname] = a
        }
        for (n in this.att) {
            if (e[n] === void 0 || !e[n]) e[n] = this.att[n]
        }
        return e
    };
    var i = function () {
        var e = {};
        var t;
        var a;
        for (a = 0; a < this.flds.length; a++) {
            t = this.flds[a];
            if (t.disporder < 1)continue;
            e[t.colname] = this.getFldInput(t.colname)
        }
        return e
    };
    var o = function (e) {
        var t = !0;
        var a, n;
        var r;
        for (r = 0; r < this.flds.length; r++) {
            a = this.flds[r];
            if (a.disporder < 1)continue;
            n = e[a.colname];
            if (a.nullable == 0) {
                if (typeof n != "number") {
                    if (n == "") {
                        t = !1;
                        cx.msg.dispErrCode("errFldNodata", gLoc ? a.namec : a.namee);
                        break
                    }
                }
            }
            if (a.minlen > 0) {
                if (n.length < a.minlen) {
                    t = !1;
                    cx.msg.dispErrCode("errFldMinlen", gLoc ? a.namec : a.namee, a.minlen);
                    break
                }
            }
            if (a.maxlen > 0) {
                if (n.length > a.maxlen) {
                    t = !1;
                    cx.msg.dispErrCode("errFldMaxlen", gLoc ? a.namec : a.namee, a.maxlen);
                    break
                }
            }
            if (a.isnum != 0) {
                if (n != "") {
                    if (cx.number.is(n) != !0) {
                        cx.msg.dispErrCode("errFldNumber", gLoc ? a.namec : a.namee);
                        return !1
                    }
                    if (a.minval != "") {
                        var i = cx.number.parse(a.minval);
                        var o = cx.number.parse(n);
                        if (o < i) {
                            t = !1;
                            cx.msg.dispErrCode("errFldMinlen", gLoc ? a.namec : a.namee, a.minlen);
                            break
                        }
                    }
                    if (a.maxval != "") {
                        var c = cx.number.parse(a.maxval);
                        var o = cx.number.parse(n);
                        if (o > c) {
                            t = !1;
                            cx.msg.dispErrCode("errFldMaxlen", gLoc ? a.namec : a.namee, a.maxlen);
                            break
                        }
                    }
                }
            } else {
                switch (a.disptype) {
                    case 3:
                        if (n != "") {
                            t = cx.date.isDate(n);
                            if (!t) {
                                cx.msg.dispError(gObj.loc.errFldDate.replace("%1", gLoc ? a.namec : a.namee));
                                break
                            }
                        }
                        break
                }
            }
        }
        return t
    };
    var c = function (e, t) {
        this._observers.push({colname: e, caller: t})
    };
    var s = function (e, t, a) {
        this._selOpts.push({colname: e, caller: t, byColName: a})
    };
    var l = function (e, t) {
        var a;
        var n = cx.array.gets(this._observers, {colname: e});
        for (a = 0; a < n.length; a++) {
            n[a].caller.call(e, t, this)
        }
        var r = cx.array.gets(this._selOpts, {byColName: e});
        var i;
        var o, c;
        for (a = 0; a < r.length; a++) {
            i = r[a];
            o = this.getFldOpts(i.colname, 3, t);
            c = o && o.length > 0 ? o[0].dbvalue : null;
            cx.select.setOpts(this._doms[i.colname], o, "dbvalue", gLoc ? "dispc" : "dispe", c);
            this.onFldChange(i.colname, c)
        }
        if (this._changeCaller) this._changeCaller.call()
    };
    var d = function (e, t, a) {
        var n = gObj.field.getFldvalues(this._tabname, e);
        if (n && n.length > 0)return n;
        var r = this._selOpts;
        var i, o;
        var c;
        for (c = 0; c < r.length; c++) {
            i = r[c];
            if (i.colname == e) {
                if (i.byColName && i.byColName != "") {
                    switch (t) {
                        case 1:
                            o = this.getFldValueAtt(i.byColName);
                            break;
                        case 2:
                            o = this.getFldValue(i.byColName);
                            break;
                        case 3:
                            o = a;
                            break
                    }
                }
                n = i.caller.call(o);
                if (n && n.length > 0)return n
            }
        }
        return null
    };
    var u = function (e) {
        var t = this.att[e];
        return t ? t : ""
    };
    var f = function (e, t) {
        if (this.att[e] !== void 0) this.att[e] = t
    };
    var v = function (e) {
        var t = cx.array.get1(this.flds, {colname: e});
        var a = this._doms[e];
        var n = "";
        if (cx.isMobile) {
            switch (t.disptype) {
                case 1:
                case 2:
                case 6:
                case 3:
                case 4:
                default:
                    n = cx.dom.getValue(a);
                    break
            }
        } else {
            switch (t.disptype) {
                case 1:
                    n = a.val();
                    break;
                case 2:
                case 6:
                    n = a.combobox("getValue");
                    break;
                case 3:
                    n = a.datebox("getValue");
                    break;
                case 4:
                case 7:
                    n = a.val();
                    break
            }
        }
        return n
    };
    var g = function (e) {
        var t = cx.array.get1(this.flds, {colname: e});
        var a = this._doms[e];
        var n = "";
        if (cx.isMobile) {
            switch (t.disptype) {
                case 1:
                case 2:
                case 6:
                case 3:
                case 4:
                default:
                    n = cx.dom.getValue(a);
                    break
            }
        } else {
            switch (t.disptype) {
                case 1:
                    n = a.val();
                    break;
                case 2:
                case 6:
                    n = a.combobox("getValue");
                    break;
                case 3:
                    var r = a.datebox("getValue");
                    if (r && r != "") {
                        if (gLoc) n = cx.date.format(cx.date.parse(r)); else n = cx.date.format(cx.date.parse1(r))
                    } else n = "";
                    break;
                case 4:
                case 7:
                    n = a.val();
                    break
            }
        }
        return n
    };
    var h = function (e, t) {
        var a = cx.array.get1(this.flds, {colname: e});
        var n = this._doms[e];
        if (!n)return;
        if (cx.isMobile) {
            switch (a.disptype) {
                case 1:
                case 2:
                case 6:
                case 3:
                case 4:
                default:
                    cx.dom.setValue(n, t);
                    break
            }
        } else {
            switch (a.disptype) {
                case 1:
                    n.textbox("setValue", t);
                    break;
                case 2:
                case 6:
                    n.combobox("setValue", t);
                    break;
                case 3:
                    n.datebox("setValue", cx.date.format1(cx.date.parse(t)));
                    break;
                case 4:
                case 7:
                    n.val(t);
                    break
            }
        }
    };
    var x = function (e) {
        if (!this._editable)return !1;
        if (this._isNew)return !0;
        var t, a, n;
        if (this.att) {
            for (t = 0; t < this.flds.length; t++) {
                a = this.flds[t];
                n = this.att[a.colname];
                switch (a.disptype) {
                    case 3:
                        if (n && n != "") {
                            n = cx.date.format(cx.date.parse(n))
                        }
                        break
                }
                if (e[a.colname] != n)return !0
            }
        }
        return !1
    };
    var m = function (e) {
        var t = this;
        var a, n;
        var r;
        t.att = e;
        for (r = 0; r < t.flds.length; r++) {
            a = t.flds[r];
            if (a.disporder < 1)continue;
            switch (a.disptype) {
                case 2:
                case 6:
                    n = t.att[a.colname];
                    var i = t.getFldOpts(a.colname, 1, null);
                    if (i) {
                        for (var o = 0; o < i.length; o++) {
                            if (i[o].dbvalue == n) {
                                this.att["_" + a.colname] = gLoc ? i[o].dispc : i[o].dispe;
                                break
                            }
                        }
                    }
                    break;
                case 3:
                    n = t.att[a.colname];
                    if (n != "") {
                        var c = cx.date.parse(n);
                        if (c) {
                            this.att["_" + a.colname] = cx.date.format(c)
                        }
                    }
                    break
            }
        }
    };
    var p = function (e, t) {
        var a = this.att[e.colname];
        var n, r;
        var i;
        n = cx.dom.create("tr", null, t, null);
        r = cx.dom.create("td", "cx-td-keycol", n, {innerHTML: (gLoc ? e.namec : e.namee) + ":"});
        i = "";
        if (a) {
            switch (e.disptype) {
                case 2:
                case 6:
                    var o = this.getFldOpts(e.colname, 1, null);
                    if (o) {
                        for (var c = 0; c < o.length; c++) {
                            if (o[c].dbvalue == a) {
                                i = gLoc ? o[c].dispc : o[c].dispe;
                                break
                            }
                        }
                    }
                    break;
                case 3:
                    if (a != "") {
                        var s = cx.date.parse(a);
                        if (s) {
                            i = cx.date.format(s)
                        }
                    }
                    break;
                default:
                    i = a;
                    break
            }
        }
        r = cx.dom.create("td", "cx-td-cell ta_l", n, {innerHTML: i})
    };
    var b = function (e) {
        var t = this;
        var a;
        var n;
        var r;
        if (t.initAtt) {
            t.initAtt(t.att, t._isNew, t)
        }
        n = cx.dom.create("table", "cx-table", e, null);
        for (r = 0; r < t.flds.length; r++) {
            a = t.flds[r];
            if (a.disporder < 1)continue;
            if (t.att[a.colname] === void 0)continue;
            t.viewFld(a, n)
        }
        cx.table.setStriped(n)
    };
    var y = function (e, t, a, n) {
        var r = this;
        var i = e.disprows > 1 ? "height:" + e.disprows * 20 + "px;" : "";
        var o = $(cx.dom.create("input", null, a, {style: i + (t && t != "" ? "width:" + t : "")}));
        o.textbox({
            multiline: e.disprows > 1 ? !0 : !1,
            disabled: !r._editable || r._isNew && e.newedit == 0 || !r._isNew && e.editable == 0 ? !0 : !1,
            onChange: function (t) {
                r.onFldChange(e.colname, t)
            }
        });
        o.textbox("setValue", n);
        r._doms[e.colname] = o
    };
    var w = function (e, t, a, n) {
        var r = this;
        var i = t && t != "" ? "width:" + t : "";
        var o = cx.dom.create("textarea", null, a, {rows: e.disprows, style: i});
        if (!r._editable || r._isNew && e.newedit == 0 || !r._isNew && e.editable == 0) o.disabled = "disabled";
        o.value = n;
        o.onchange = function (t) {
            r.onFldChange(e.colname, t)
        };
        r._doms[e.colname] = o
    };
    var C = function (e, t, a, n) {
        var r = this;
        var i = t && t != "" ? "width:" + t : "";
        var o = this.getFldOpts(e.colname, 2, null);
        var c = $(cx.dom.create("input", "easyui-combobox", a, {style: i}));
        c.combobox({
            editable: !1,
            disabled: !r._editable || r._isNew && e.newedit == 0 || !r._isNew && e.editable == 0 ? !0 : !1,
            onChange: function (t) {
                r.onFldChange(e.colname, t["dbvalue"])
            }
        });
        cx.select.setOpts(c, o, "dbvalue", gLoc ? "dispc" : "dispe", n);
        if (n && n != "") {
            c.combobox("setValue", n)
        }
        r._doms[e.colname] = c
    };
    var D = function (e, t, a, n) {
        var r = this;
        var i = t && t != "" ? "width:" + t : "";
        var o = this.getFldOpts(e.colname, 2, null);
        var c = $(cx.dom.create("input", "easyui-combobox", a, {style: i}));
        c.combobox({
            editable: !0,
            disabled: !r._editable || r._isNew && e.newedit == 0 || !r._isNew && e.editable == 0 ? !0 : !1,
            onChange: function (t) {
                r.onFldChange(e.colname, t["dbvalue"])
            }
        });
        cx.select.setOpts(c, o, "dbvalue", gLoc ? "dispc" : "dispe", n);
        if (n && n != "") {
            c.combobox("setValue", n)
        }
        r._doms[e.colname] = c
    };
    var S = function (e, t, a, n) {
        var r = this;
        var i = t && t != "" ? "width:" + t : "";
        var o = $(cx.dom.create("input", "easyui-datebox", a, {style: i}));
        o.datebox({
            disabled: !r._editable || r._isNew && e.newedit == 0 || !r._isNew && e.editable == 0 ? !0 : !1,
            currentText: gObj.loc.today,
            closeText: gObj.loc.close,
            onSelect: function (t) {
                r.onFldChange(e.colname, t)
            }
        });
        if (n && n != "") {
            if (gLoc) o.datebox("setValue", cx.date.format(cx.date.parse(n))); else o.datebox("setValue", cx.date.format1(cx.date.parse(n)))
        }
        r._doms[e.colname] = o
    };
    var O = function (e, t, a, n) {
        var r = this;
        var i = t && t != "" ? "width:" + t : "";
        var o = $(cx.dom.create("textarea", null, a, {rows: e.disprows, style: i}));
        o.xheditor({
            plugins: cx.editor.getPlugins(),
            tools: "viewFile,attachFile,|,Fontface,FontSize,FontColor,BackColor,|,Bold,Italic,Underline,Strikethrough,|,SelectAll,Removeformat,/,Cut,Copy,Paste,Pastetext,|,Blocktag,Align,List,Outdent,Indent,|,Hr,Emot,Table,Link,Unlink,Anchor,Img,Flash,Media,|,Preview,Print,Fullscreen",
            skin: "o2007silver",
            readonly: !r._editable || r._isNew && e.newedit == 0 || !r._isNew && e.editable == 0 ? !0 : !1,
            height: e.disprows * 15 + 25,
            width: 700
        });
        o.val(n);
        r._doms[e.colname] = o
    };
    var I = function (e, t, a, n) {
        var r = this;
        var i = gObj.field.getFldvalues(r._tabname, e.colname);
        var o = cx.array.get1(i, {dbvalue: "BS"});
        var c = cx.parser.getOptions(o.dispc);
        var s = t && t != "" ? "width:" + (parseInt(t) - 2) + "px" : "";
        var l = cx.dom.create("div", null, a, {style: s});
        var d = new cx.ctrl.ValButton(cx.extend({}, c, {readonly: !r._editable || r._isNew && e.newedit == 0 || !r._isNew && e.editable == 0 ? !0 : !1}));
        d.create(l);
        if (n && n != "") {
            d.val(n)
        }
        r._doms[e.colname] = d
    };
    var T = function (e, t, a) {
        var n = cx.dom.create("td", t, a, null);
        var r = "";
        if (e.nullable == 0) r += " *";
        if (e.minlen != 0 || e.maxlen != 0) {
            r += " " + gObj.loc.fldLenrang;
            if (e.minlen == e.maxlen) {
                r += e.minlen
            } else {
                if (e.minlen != 0) r += e.minlen;
                r += "-";
                if (e.maxlen != 0) r += e.maxlen
            }
        }
        if (e.minval != "" || e.maxval != "") {
            r += " " + gObj.loc.fldValrang;
            if (e.minval != "") r += e.minval;
            r += "-";
            if (e.maxval != "") r += e.maxval
        }
        n.innerHTML = r
    };
    var P = function (e, t, a, n) {
        var r = this;
        if (n % this._dispCols == 0) {
            var i = cx.dom.create("tr", null, e, null);
            r.tr = i
        }
        var o = (gLoc ? t.namec : t.namee) + (t.nullable == 0 ? '<span class="cx-td-required">&nbsp;*</span>' : "") + ":";
        var c = cx.dom.create("td", "cx-td-keycol", r.tr, {innerHTML: o});
        var s = cx.dom.create("td", "cx-td-layout", r.tr, null);
        switch (t.disptype) {
            default:
            case 1:
                r.dispTextBox(t, r._widthVal, s, a);
                break;
            case 2:
                r.dispSelect(t, r._widthVal, s, a);
                break;
            case 3:
                r.dispDate(t, r._widthVal, s, a);
                break;
            case 4:
                r.dispEditor(t, r._widthVal, s, a);
                break;
            case 6:
                r.dispDropdown(t, r._widthVal, s, a);
                break;
            case 7:
                r.dispValButton(t, r._widthVal, s, a);
                break
        }
    };
    var k = function (e) {
        return !this._editable || this._isNew && e.newedit == 0 || !this._isNew && e.editable == 0 ? !0 : !1
    };
    var _ = function (e, t, a) {
        var n = this.isReadOnly(e);
        return "<input" + cx.dom.getKeyVal("id", t) + cx.dom.getKeyVal("type", "text") + (!n ? cx.dom.getKeyVal("data-clear-btn", "!0") : "") + cx.dom.getKeyVal("placeholder", gLoc ? e.namec : e.namee) + (n ? cx.dom.getKeyVal("readonly", "readonly") : "") + cx.dom.getKeyVal("class", n ? "cx-readonly-bg" : "") + cx.dom.getKeyVal("value", a) + ">"
    };
    var N = function (e, t, a) {
        var n = this.isReadOnly(e);
        return "<textarea" + cx.dom.getKeyVal("id", t) + cx.dom.getKeyVal("rows", e.disprows) + (!n ? cx.dom.getKeyVal("data-clear-btn", "!0") : "") + cx.dom.getKeyVal("placeholder", gLoc ? e.namec : e.namee) + (n ? cx.dom.getKeyVal("readonly", "!0") : "") + cx.dom.getKeyVal("class", n ? "cx-readonly-bg" : "") + ">" + a + "</textarea>"
    };
    var E = function (e, t, a) {
        var n = this.isReadOnly(e);
        var r = this.getFldOpts(e.colname, 2, null);
        return "<select" + cx.dom.getKeyVal("id", t) + (!n ? cx.dom.getKeyVal("data-clear-btn", "!0") : "") + cx.dom.getKeyVal("placeholder", gLoc ? e.namec : e.namee) + (n ? cx.dom.getKeyVal("disabled", "disabled") : "") + cx.dom.getKeyVal("class", n ? "cx-readonly-bg" : "") + ">" + cxm.select.getOptionStr(r, "dbvalue", gLoc ? "dispc" : "dispe", a) + "</select>";
    };
    var j = function (e, t, a) {
        var n = this.isReadOnly(e);
        return "<input" + cx.dom.getKeyVal("id", t) + cx.dom.getKeyVal("type", "date") + (!n ? cx.dom.getKeyVal("data-clear-btn", "!0") : "") + cx.dom.getKeyVal("placeholder", gLoc ? e.namec : e.namee) + (n ? cx.dom.getKeyVal("readonly", "readonly") : "") + cx.dom.getKeyVal("class", n ? "cx-readonly-bg" : "") + cx.dom.getKeyVal("value", a) + ">"
    };
    var L = function (e) {
        var t = "";
        if (e.nullable == 0) t += '<span class="c_red">*</span>';
        return t
    };
    var R = function (e, t) {
        var a = this;
        var n = a.idpre + e.colname;
        var r;
        var i = "";
        var o = t !== void 0 ? t : "";
        r = "<tr" + cx.dom.getKeyVal("class", "form-group") + ">" + "<td" + cx.dom.getKeyVal("class", "form-keycol") + ">" + (gLoc ? e.namec : e.namee) + a.dispLimitM(e) + ":" + "</td>" + "<td" + cx.dom.getKeyVal("class", "form-valuecol") + ">";
        switch (e.disptype) {
            default:
            case 1:
                if (e.disprows > 1) i = a.dispTextAreaM(e, n, o); else i = a.dispTextBoxM(e, n, o);
                break;
            case 4:
                i = a.dispTextBoxM(e, n, o);
                break;
            case 2:
            case 6:
                i = a.dispSelectM(e, n, o);
                break;
            case 3:
                i = a.dispDateM(e, n, o);
                break
        }
        return r + i + "</td></tr>"
    };
    var M = function () {
        var e = this;
        var t, a;
        var n;
        var r = "";
        r = "<table" + cx.dom.getKeyVal("class", "cx-form w_100p") + ">";
        for (n = 0; n < e.flds.length; n++) {
            t = e.flds[n];
            if (t.disporder < 1)continue;
            r += e.dispFldM(t, e.att[t.colname])
        }
        r += "</table>";
        $(cx.dom.getDomNode(e.domNode)).html(r).trigger("create");
        var i = function (t, a) {
            a.onchange = function () {
                e.onFldChange(t.colname, e.getFldInput(t.colname))
            }
        };
        var o;
        for (n = 0; n < e.flds.length; n++) {
            t = e.flds[n];
            if (t.disporder < 1)continue;
            a = cx.dom.getDomNode(e.idpre + t.colname);
            e._doms[t.colname] = a;
            switch (t.disptype) {
                case 3:
                    o = cx.date.parse(e.att[t.colname]);
                    if (o) {
                        o.setDate(o.getDate() + 1);
                        $(a).prop("valueAsDate", o)
                    }
                    break
            }
            i(t, a)
        }
    };
    var A = function () {
        if (cx.isMobile) {
            this.dispM()
        } else {
            var e;
            var t;
            var a = 0;
            var n = cx.dom.create("table", "cx-tablelayout w_100p", this.domNode, null);
            for (t = 0; t < this.flds.length; t++) {
                e = this.flds[t];
                if (e.disporder < 1)continue;
                a++;
                this.dispFld(n, e, this.att[e.colname], a)
            }
        }
    };
    var F = function (e) {
        if (this.checkInput(e) == !1)return !1;
        if (this.checkAtt) {
            if (this.checkAtt(e) != !0)return !1
        }
        return !0
    };
    var B = e.prototype;
    B.init = t;
    B.getDefVal = a;
    B.getDefValExp = n;
    B.getVal = r;
    B.getValInput = i;
    B.checkInput = o;
    B.addObserver = c;
    B.addSelOpt = s;
    B.onFldChange = l;
    B.getFldOpts = d;
    B.getFldValueAtt = u;
    B.setFldValueAtt = f;
    B.getFldInput = v;
    B.getFldValue = g;
    B.setFldValue = h;
    B.getChanged = x;
    B.getDisp = m;
    B.viewFld = p;
    B.viewTable = b;
    B.dispTextBox = y;
    B.dispSelect = C;
    B.dispDropdown = D;
    B.dispDate = S;
    B.dispEditor = O;
    B.dispValButton = I;
    B.dispLimit = T;
    B.dispFld = P;
    B.isReadOnly = k;
    B.dispTextBoxM = _;
    B.dispTextAreaM = N;
    B.dispSelectM = E;
    B.dispDateM = j;
    B.dispLimitM = L;
    B.dispFldM = R;
    B.dispM = M;
    B.disp = A;
    B.validate = F;
    return e
}();
cx.frm.AttManager = function () {
    var e = function () {
    };
    var t = function (e, t, a) {
        return new cx.frm.AttBase(a)
    };
    var a = e.prototype;
    a.byMajorMinor = t;
    return e
}();
cx.frm.AttOper = function () {
    var e = function () {
    };
    var t = function (e, t, a, n) {
        var r = gObj.service.getExe("AttIns");
        var i = {_major: e, _minor: t};
        cx.extend(i, r.getInitPara(), a);
        r.execute(i, new Caller(function (r, i) {
            if (i.ret == 0) {
                a.id = i.id;
                if (n) n.call(a);
                gObj.observer.publish("AttInsert", {major: e, minor: t, id: i.id, newAtt: a})
            }
        }))
    };
    var a = function (e, t, a, n) {
        var r = gObj.service.getExe("AttIns_File");
        var i = {_major: e, _minor: t};
        cx.extend(i, r.getInitPara(), a);
        r.execute(i, new Caller(function (r, i) {
            if (i.ret == 0) {
                a.id = i.id;
                if (n) n.call(a);
                gObj.observer.publish("AttInsert", {major: e, minor: t, id: i.id, newAtt: a})
            }
        }))
    };
    var n = function (e, t, a, n, r) {
        var i = gObj.service.getExe("AttDelId");
        var o = {_major: e, _minor: t, id: a};
        cx.extend(o, i.getInitPara());
        i.execute(o, new Caller(function (i, o) {
            if (o.ret == 0) {
                if (r) r.call(n);
                gObj.observer.publish("AttDelete", {major: e, minor: t, id: a, oldAtt: n})
            }
        }))
    };
    var r = function (e, t, a, n, r) {
        var i = gObj.service.getExe("AttDelId_File");
        var o = {_major: e, _minor: t, id: a, filename: n.filename};
        cx.extend(o, i.getInitPara());
        i.execute(o, new Caller(function (i, o) {
            if (o.ret == 0) {
                if (r) r.call(n);
                gObj.observer.publish("AttDelete", {major: e, minor: t, id: a, oldAtt: n})
            }
        }))
    };
    var i = function (e, t, a, n, r, i) {
        var o = gObj.service.getExe("AttUpdId");
        var c = {_major: e, _minor: t, id: a};
        var s = function (n) {
            cx.extend(c, o.getInitPara(), n);
            o.execute(c, new Caller(function (o, c) {
                if (c.ret == 0) {
                    if (i) i.call(n, r);
                    gObj.observer.publish("AttUpdate", {major: e, minor: t, id: a, newAtt: n, oldAtt: r})
                }
            }))
        };
        if (gObj.editBus) {
            gObj.editBus.makeSvrAttForUpd(e, t, a, n, function (e) {
                s(e)
            })
        } else {
            s(n)
        }
    };
    var o = e.prototype;
    o.insert = t;
    o.insert_File = a;
    o.del = n;
    o.del_File = r;
    o.update = i;
    return e
}();
cx.frm.ServiceExe = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, ["load"]);
        t.ready.ui = !0;
        t._def = e
    };
    var t = function () {
        return this.data.load
    };
    var a = function () {
        return this._def.initpara
    };
    var n = function (e, t) {
        this.ready.data = !1;
        this.data.load = [];
        var a = this._def;
        var n = {_service_: a.name};
        cx.extend(n, a.initpara, e);
        var r = this;
        cx.ajax.post(a.url, n, a.delfile, function (e, a) {
            delete e._service_;
            var n = r.getResult(a);
            r.setDataObj(n);
            r.data.load = n;
            r.readyData(n);
            if (t) {
                t.call(n)
            }
        })
    };
    var r = function (e, t) {
        if (this._def.type == 2) {
            this.ready.data = !1;
            this.data.load = {}
        }
        if (this.isReady()) {
            t.call(this.getData())
        } else {
            this.loadData(e, t)
        }
    };
    var i = function (e) {
        var t = this._def.dataobj;
        if (t != "") {
            var a = window;
            var n = t.split(".");
            for (var r = 0; r < n.length - 1; r++) {
                if (r == 0) {
                    if (n[r] == "gObj") {
                        a = gObj
                    }
                } else {
                    a = a[n[r]]
                }
            }
            a[n[r]] = e
        }
    };
    var o = function (e) {
        if (e === void 0 || !e)return null;
        if (e.length < 1)return [];
        if (this._def.onercd == 1)return e[0];
        return e
    };
    var c = function (e, t) {
        this.ready.data = !1;
        this.data.load = [];
        var a = this._def;
        var n = {_service_: a.name};
        cx.extend(n, a.initpara, e);
        var r = this;
        cx.ajax.post(a.url, n, a.delfile, function (e, a) {
            delete e._service_;
            var n = a;
            r.setDataObj(n);
            r.data.load = n;
            r.readyData(n);
            if (t) {
                t.call(e, n)
            }
        })
    };
    var s = function () {
        this.ready.data = !1
    };
    cx.inherits(e, cx.frm.PluginBase);
    var l = e.prototype;
    l.getData = t;
    l.getInitPara = a;
    l.loadData = n;
    l.checkData = r;
    l.setDataObj = i;
    l.getResult = o;
    l.execute = c;
    l.clearBuf = s;
    return e
}();
cx.frm.DataReader = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, {
            type: 1,
            url: e.url,
            para: "",
            dataobj: "",
            delfile: 0,
            onercd: 0,
            prereq: "",
            exp: e.exp,
            initpara: null
        })
    };
    cx.inherits(e, cx.frm.ServiceExe);
    return e
}();
cx.frm.ServiceExes = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, null);
        t.ready.ui = !0;
        t._readyCall = null;
        t.times = 0;
        t.curTimes = 0
    };
    var t = function () {
        var e = this.plugin;
        this.times = 0;
        this.curTimes = 0;
        if (e) {
            for (var t in e) {
                this.times++
            }
        }
        if (this.times == 0) {
            this.readyData(null)
        }
    };
    var a = function (e) {
        this.curTimes++;
        if (this.curTimes >= this.times) {
            this.ready.data = !0;
            if (this.isReady()) {
                if (this._readyCall) {
                    this._readyCall.call(null)
                }
            }
        }
    };
    var n = function (e) {
        this._readyCall = e
    };
    cx.inherits(e, cx.frm.PluginBase);
    var r = e.prototype;
    r.init = t;
    r.readyData = a;
    r.setReadyCall = n;
    return e
}();
cx.frm.Service = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["service"]);
        e.ready.ui = !0
    };
    var t = function () {
        var e = this.data.service;
        var t, a;
        for (var n in e) {
            t = e[n];
            a = t.initpara;
            if (a) {
                if (a == "") t.initpara = null
            }
            t.exp = "";
            t.exe = null
        }
    };
    var a = function (e) {
        return cx.array.get1(this.data.service, {name: e})
    };
    var n = function (e) {
        var t = cx.array.get1(this.data.service, {name: e});
        if (!t)return null;
        if (!t.exe) {
            t.exe = new cx.frm.ServiceExe(t);
            t.exe.init()
        }
        return t.exe
    };
    var r = function (e) {
        var t = new cx.frm.ServiceExes;
        if (!t)return null;
        var a = e.split(",");
        var n;
        for (var r in a) {
            n = this.getExe(a[r]);
            if (n) t.addPlugin({name: a[r], plugin: n, loadData: !1, callName: "checkData"})
        }
        return t
    };
    var i = function (e) {
        var t;
        for (var a in this.data.service) {
            t = this.data.service[a];
            if (t.cata == e) {
                if (t.exe) t.exe.ready.data = !1
            }
        }
    };
    var o = function (e) {
        var t = cx.array.get1(this.data.service, {name: e});
        if (t) {
            if (t.exe) t.exe.ready.data = !1
        }
    };
    cx.inherits(e, cx.frm.PluginBase);
    var c = e.prototype;
    c.start = t;
    c.byName = a;
    c.getExe = n;
    c.getExes = r;
    c.clearData = i;
    c.clearExe = o;
    return e
}();
cx.frm.HtmlCache = function () {
    var e = function () {
        var e = this;
        cx.base(e, null);
        e.ready.ui = !0
    };
    var t = function (e, t) {
        var a = this;
        var n = [];
        for (var r in e) {
            var i = {};
            i.type = 3;
            i.url = e[r];
            i.onLoad = new Caller(function (e) {
                var t = e.split("\r\n");
                var n, r, i, o;
                for (var c = 0; c < t.length; c++) {
                    n = t[c];
                    r = n.indexOf("=");
                    if (r < 0)continue;
                    i = n.substring(0, r);
                    o = n.substring(r + 1);
                    a[i] = o
                }
            });
            n.push(i)
        }
        var o = new cx.frm.AsynchMan;
        o.setIntents(n, t)
    };
    var a = function (e) {
        if (this[e])return this[e]
    };
    cx.inherits(e, cx.frm.PluginBase);
    var n = e.prototype;
    n.load = t;
    n.get = a;
    return e
}();
gObj.htmlCache = new cx.frm.HtmlCache;
cx.frm.InitData = function () {
    var e = function () {
        var e = this;
        cx.base(e, null);
        e.ready.ui = !0
    };
    var t = function () {
        if (!this.initPara || !this.initPara.service || this.initPara.service == "") {
            this.readyData(null)
        } else {
            var e = gObj.service.getExes(this.initPara.service);
            e.setReadyCall(new Caller(this, "readyData"));
            e.init();
            this.addPlugin({name: "exes", plugin: e, loadData: !1, callName: ""});
            var t = e.plugin;
            var a;
            for (var n in t) {
                a = t[n];
                a.checkData(a._def.initpara, new Caller(e, "readyData"))
            }
        }
    };
    var a = function () {
        CallPlugin("InitSys")
    };
    cx.inherits(e, cx.frm.PluginBase);
    var n = e.prototype;
    n.init = t;
    n.start = a;
    return e
}();
cx.frm.InitRunenv = function () {
    var e = function () {
        var e = this;
        cx.base(e, null);
        e.ready.ui = !0
    };
    var t = function () {
        this.addPlugin({
            name: "init",
            plugin: new cx.frm.DataReader({url: "InitSvr", exp: ""}),
            loadData: !1,
            callName: ""
        });
        var e = this.plugin;
        for (var t in e) {
            e[t].init();
            e[t].checkData({cmd: "get"}, new Caller(this, "readyData"))
        }
    };
    var a = function (e) {
        var t = !0;
        for (var a in this.plugin) {
            if (!this.plugin[a].isReady()) {
                t = !1;
                break
            }
        }
        if (t) {
            this.start()
        }
    };
    var n = function () {
        var e = gObj;
        var t = cx.frm;
        var a = this.plugin.init.getData()[0];
        var n, r;
        var i;
        e.init = a;
        e.syscfg = {};
        n = a.syscfg;
        for (i in n) {
            e.syscfg[n[i].keyno] = n[i].value
        }
        this.checkSysVersion();
        n = e.init.urlmap;
        if (n && cx.svr) {
            for (i = 0; i < n.length; i++) {
                r = n[i];
                cx.svr.url[r.name] = r.url
            }
        }
        n = a.service;
        for (i = 0; i < n.length; i++) {
            r = n[i];
            r.url = cx.svr.getUrl(r.url)
        }
        e.syscfg.today = cx.date.parse(a.user.time);
        e.observer = new t.Observer;
        e.observer.init();
        e.entity = new t.Entity;
        e.entity.init();
        e.entity.setData({load: a.entity});
        e.field = new t.Field;
        e.field.init();
        e.field.setData({fld: a.fld, fldvalue: a.fldvalue});
        e.service = new t.Service;
        e.service.init();
        e.service.setData({service: a.service});
        e.access = new t.Access;
        e.access.init();
        e.access.setData({load: a.access});
        e.plugin = new t.Plugin;
        e.plugin.init();
        e.plugin.setData({plugin: a.plugin});
        e.func = new t.Func;
        e.func.init();
        e.func.setData({group: a.funcgrp, func: a.func});
        e.fldcfg = new t.FieldCfg;
        e.fldcfg.init();
        e.fldcfg.setData({fldcfg: a.fldcfg});
        e.user = a.user;
        var o = 0;
        if (e.syscfg.undoMax) o = parseInt(e.syscfg.undoMax);
        e.undo = new cx.undo.Manager({maxSize: o});
        CallPlugin("InitSys")
    };
    var r = function () {
        var e = cx.cache.get("SoftVersion");
        var t = gObj.syscfg.SoftVersion;
        if (t && t != "") {
            cx.cache.set("SoftVersion", t)
        }
        if (e && e != "" && t && t != "" && e != e) {
            closeLoading();
            cx.msg.dispErrCode("newVersion");
            return !1
        }
    };
    cx.inherits(e, cx.frm.PluginBase);
    var i = e.prototype;
    i.init = t;
    i.readyData = a;
    i.start = n;
    i.checkSysVersion = r;
    return e
}();
cx.frm.IndexReader = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, ["load"]);
        t.ready.ui = !0;
        t._def = e
    };
    var t = function () {
        return this.data.load
    };
    var a = function (e) {
        var t;
        this.ready.data = !1;
        this.data.load = null;
        var a = this._def;
        var n = a.keycol;
        var r = "3";
        for (t in a.cols)n += "," + a.cols[t];
        for (t in a.types)r += "," + a.types[t];
        var i = {datasource: a.datasource, table: a.table, cols: n, types: r};
        var o = this;
        cx.ajax.post("SqlSelect", i, 0, function (t, a) {
            var n = a;
            o.data.load = n;
            o.readyData(n);
            e.call(n)
        })
    };
    cx.inherits(e, cx.frm.PluginBase);
    var n = e.prototype;
    n.getData = t;
    n.loadData = a;
    return e
}();
cx.frm.IndexReaders = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, ["load"]);
        t.ready.ui = !0;
        t._readyCall = null
    };
    var t = function () {
        var e = this.plugin;
        var t = !0;
        if (e) {
            for (var a in e) {
                if (e[a].ready.data != !0) {
                    t = !1;
                    break
                }
            }
        }
        if (t) {
            this.readyData(null)
        }
    };
    var a = function (e) {
        var t = this.plugin;
        if (t) {
            var a = !0;
            for (var n in t) {
                if (t[n].ready.data != !0) {
                    a = !1;
                    break
                }
            }
            if (a != !0)return
        }
        this.ready.data = !0;
        if (this.isReady()) {
            this.mergeData();
            var r = this._readyCall;
            if (r) r.call()
        }
    };
    var n = function (e) {
        this._readyCall = e
    };
    var r = function () {
        var e = this.plugin;
        var t = null;
        if (e) {
            var a, n, r, i, o;
            for (var c in e) {
                a = e[c];
                n = a._def;
                if (!t) {
                    t = a.getData();
                    continue
                }
                r = a.getData();
                for (var s in r) {
                    i = r[s];
                    var l = {};
                    l[n.keycol] = i[n.keycol];
                    o = cx.array.get1(t, l);
                    if (o) {
                        for (var d in n.cols) {
                            o[n.cols[d]] = i[n.cols[d]]
                        }
                    }
                }
            }
        }
        this.data.load = t
    };
    var i = function () {
        return this.data.load
    };
    cx.inherits(e, cx.frm.PluginBase);
    var o = e.prototype;
    o.init = t;
    o.readyData = a;
    o.setReadyCall = n;
    o.mergeData = r;
    o.getData = i;
    return e
}();
cx.frm.IndexMan = function () {
    var e = function () {
        var e = this;
        cx.base(e, ["data", "tab", "grp", "idx", "col"]);
        e.ready.ui = !0;
        e.index = []
    };
    var t = function () {
        this.build()
    };
    var a = function () {
        var e = this.data.data;
        for (var t = 0; t < e.length; t++) {
            var a = {};
            a.name = gLoc ? e[t].namec : e[t].namee;
            a.layers = e[t].layers;
            a.grp = [];
            a.text = a.name;
            a.children = [];
            this.addGrp(a, e[t].name);
            if (a.grp !== void 0) this.index.push(a)
        }
    };
    var n = function (e, t) {
        var a = this.data.grp;
        for (var n = a.length - 1; n >= 0; n--) {
            if (a[n].upper == t) {
                var r = {};
                r.name = gLoc ? a[n].namec : a[n].namee;
                r.grp = [];
                r.idx = [];
                r.type = a[n].type;
                r.layers = e.layers;
                r.text = r.name;
                r.children = [];
                r.upper = t;
                r.idxgrp = a[n].name;
                r.tmp = a[n].name;
                cx.array.insert(e.grp, r);
                cx.array.insert(e.children, r);
                this.addIdx(r, a[n].name)
            }
        }
        for (var n = 0; n < e.grp.length; n++) {
            var i = e.grp[n];
            this.addGrp(i, i.tmp);
            delete i.tmp
        }
        if (e.grp.length < 1) delete e.grp
    };
    var r = function (e, t) {
        var a = this.data.idx;
        for (var n = 0; n < a.length; n++) {
            if (a[n].idxgrp == t) {
                var r = {};
                r.code = a[n].code;
                r.name = gLoc ? a[n].namec : a[n].namee;
                r.valtype = a[n].valtype;
                r.idxgrp = a[n].idxgrp;
                r.type = a[n].type;
                r.layers = e.layers;
                e.idx.push(r)
            }
        }
    };
    var i = function (e, t) {
        return this.data.col[e][t]
    };
    var o = function (e) {
        return cx.array.get1(this.data.tab, {tabname: e})
    };
    var c = function (e, t) {
        var a = [];
        var n = {};
        var r = "";
        var i = {};
        var o = [];
        for (var c in e) {
            var s = e[c].split("-");
            if (s[2] != 0) {
                var l = {};
                l.code = s[0];
                l.valtype = s[1];
                l.tabname = s[3];
                l.datasource = s[4];
                l.layer = gObj.region.getCur().name;
                a.push(l);
                n[l.tabname] = null
            } else {
                r = r + e[c].split("-")[0] + ",";
                i[e[c].split("-")[0]] = e[c].split("-")[1]
            }
        }
        r = r.substring(0, r.length - 1);
        if (r != "") {
            cx.ajax.post("GetIdxTab", {layer: gObj.region.getCur().name, cols: r}, 0, function (e, r) {
                for (var o in r) {
                    var c = {};
                    c.code = r[o].colname;
                    c.valtype = i[c.code];
                    c.tabname = r[o].tabname;
                    c.datasource = r[o].datasource;
                    c.layer = gObj.region.getCur().name;
                    a.push(c);
                    n[c.tabname] = null
                }
                var s = [];
                for (var l in n) {
                    var d = {};
                    var u = cx.array.get1(a, {tabname: l});
                    d.datasource = u.datasource;
                    d.table = l;
                    d.cols = [];
                    d.types = [];
                    d.keycol = gObj.region.byName(u.layer).linkfld;
                    d.exp = null;
                    d.orderby = null;
                    for (var o in a) {
                        var f = a[o];
                        if (f.tabname != l)continue;
                        d.cols.push(f.code);
                        d.types.push(f.valtype)
                    }
                    s.push(d)
                }
                var v = new cx.frm.IndexReaders;
                v.setReadyCall(t);
                for (var l in s) {
                    var d = s[l];
                    var g = new cx.frm.IndexReader(s[l]);
                    v.addPlugin({name: d.table, plugin: g, checkData: !1, callName: null});
                    g.loadData(new Caller(v, "readyData"))
                }
                var h = [];
                for (var o in a) {
                    h.push(a[o].code)
                }
                v.getFlds = function () {
                    return h
                };
                gObj.readers = v
            })
        } else {
            var d = [];
            for (var c in n) {
                var u = {};
                var f = cx.array.get1(a, {tabname: c});
                u.datasource = f.datasource;
                u.table = c;
                u.cols = [];
                u.types = [];
                u.keycol = gObj.region.byName(f.layer).linkfld;
                u.exp = null;
                u.orderby = null;
                for (var v in a) {
                    var g = a[v];
                    if (g.tabname != c)continue;
                    u.cols.push(g.code);
                    u.types.push(g.valtype)
                }
                d.push(u)
            }
            var h = new cx.frm.IndexReaders;
            h.setReadyCall(t);
            for (var c in d) {
                var u = d[c];
                var x = new cx.frm.IndexReader(d[c]);
                h.addPlugin({name: u.table, plugin: x, checkData: !1, callName: null});
                x.loadData(new Caller(h, "readyData"))
            }
            var m = [];
            for (var v in a) {
                m.push(a[v].code)
            }
            h.getFlds = function () {
                return m
            };
            gObj.readers = h
        }
    };
    cx.inherits(e, cx.frm.PluginBase);
    var s = e.prototype;
    s.start = t;
    s.build = a;
    s.addGrp = n;
    s.addIdx = r;
    s.tabByIdx = i;
    s.dsByTab = o;
    s.getReaders = c;
    return e
}();
cx.svr = function () {
    var e = function () {
    };
    var t = {InitSvr: "InitSvr", LoginSvr: "LoginSvr", AreaSvr: "AreaSvr", FileSvr: "FileSvr"};
    var a = function (e) {
        if (this.url[e])return this.url[e];
        return e
    };
    var n = function (e, t, a, n, r) {
        var i = {cmd: t};
        cx.extend(i, a);
        cx.ajax.post(e, i, a.delFile, function (e, t) {
            if (n) {
                var a = typeof n;
                if (a == "function") n(e, t); else if (n instanceof Caller) n.call(e, t)
            }
        })
    };
    e.url = t;
    e.getUrl = a;
    e.execute = n;
    return e
}();
cx.svr.Area = function () {
    var e = function () {
    };
    var t = function () {
        return cx.svr.getUrl("AreaSvr")
    };
    var a = function (e, t, a) {
        cx.svr.execute(this.url(), "queryByWin", e, t, a)
    };
    var n = function (e, t, a) {
        cx.svr.execute(this.url(), "queryByExp", e, t, a)
    };
    var r = function (e, t, a) {
        cx.svr.execute(this.url(), "queryByCol", e, t, a)
    };
    var i = function (e, t, a, n, r) {
        var i = {_major: e, _minor: t, expcols: "id0", exptypes: "1", expvals: a};
        cx.svr.execute(this.url(), "queryByCol", i, n, r)
    };
    var o = function (e, t, a) {
        cx.svr.execute(this.url(), "updateAtt", e, t, a)
    };
    var c = function (e, t, a) {
        cx.svr.execute(this.url(), "updateAtts", e, t, a)
    };
    e.url = t;
    e.queryByWin = a;
    e.queryByExp = n;
    e.queryByCol = r;
    e.queryByCol_id0 = i;
    e.updateAtt = o;
    e.updateAtts = c;
    return e
}();
cx.svr.Bpm = {
    memberOfGroup: function (e, t, a) {
        cx.svr.execute(this.url, "memberOfGroup", e, t, a)
    }, addDeployment: function (e, t, a) {
        cx.svr.execute(this.url, "addDeploy", e, t, a)
    }, delDeployment: function (e, t, a) {
        cx.svr.execute(this.url, "delDeploy", e, t, a)
    }, getProcDef: function (e, t, a) {
        cx.svr.execute(this.url, "getProcDef", {key: e}, t, a)
    }, startProcess: function (e, t, a) {
        cx.svr.execute(this.url, "startProcess", e, t, a)
    }, claimTask: function (e, t, a) {
        cx.svr.execute(this.url, "claimTask", e, t, a)
    }, unclaimTask: function (e, t, a) {
        cx.svr.execute(this.url, "unclaimTask", e, t, a)
    }, completeTask: function (e, t, a) {
        cx.svr.execute(this.url, "completeTask", e, t, a)
    }, url: cx.svr.getUrl("BpmSvr")
};
cx.svr.File = function () {
    var e = function () {
    };
    var t = function () {
        return cx.svr.getUrl("FileSvr")
    };
    var a = function (e, t, a) {
        cx.svr.execute(this.url(), "getDirs", e, t, a)
    };
    var n = function (e, t, a) {
        cx.svr.execute(this.url(), "getDirFiles", e, t, a)
    };
    var r = function (e, t, a) {
        cx.svr.execute(this.url(), "createDir", e, t, a)
    };
    var i = function (e, t, a) {
        cx.svr.execute(this.url(), "saveFile", e, t, a)
    };
    e.url = t;
    e.getDirs = a;
    e.getDirFiles = n;
    e.createDir = r;
    e.saveFile = i;
    return e
}();
cx.svr.Identity = {
    userInOrgan: function (e, t, a) {
        cx.svr.execute(this.url(), "userInOrgan", {id: e}, t, a)
    }, memberOfGroup: function (e, t, a) {
        cx.svr.execute(this.url(), "memberOfGroup", {no: e}, t, a)
    }, memberOfOrganPos: function (e, t, a, n) {
        cx.svr.execute(this.url(), "memberOfOrganPos", {code: e, position: t}, a, n)
    }, url: function () {
        return cx.svr.getUrl("IdentitySvr")
    }
};
cx.svr.Login = function () {
    var e = function () {
    };
    var t = function () {
        return cx.svr.getUrl("LoginSvr")
    };
    var a = function (e, t, a) {
        cx.svr.execute(this.url(), "getOlUsers", e, t, a)
    };
    e.url = t;
    e.getOlUsers = a;
    return e
}();
namespace("cx.undo.Data");
cx.undo.Data = function () {
    var e = function (e) {
        var t = this;
        e = e || {};
        t.atts = [];
        t.graPnt = [];
        t.graLin = [];
        t.graAtt = [];
        t.label = [];
        t.times = 0;
        t.curTimes = 0;
        t.noAid = !!e.noAid;
        t.readyCall = e.readyCall
    };
    var t = function () {
        if (this.curTimes >= this.times && this.times >= 0) {
            this.curTimes = -1;
            this.times = -1;
            if (this.readyCall) {
                this.readyCall.call()
            }
        }
    };
    var a = function (e, t, a) {
        var n = this;
        n.times++;
        cx.svr.SvrArea.getAtt({_major: e, _minor: t, id: a}, function (e, t) {
            n.atts.push({major: e._major, minor: e._minor, att: t[0]});
            n.curTimes++;
            n.start()
        })
    };
    var n = function (e, t, a, n) {
        var r = this;
        r.times++;
        cx.svr.SvrArea.getGraph({_major: e, _minor: 0, id: a}, function (e, t) {
            n.push(t[0]);
            r.curTimes++;
            r.start()
        });
        if (!r.noAid) {
            r.fromDbLabel(e, t, a);
            r.fromDbAttach(e, t, a)
        }
    };
    var r = function (e, t, a, n) {
        var r = this;
        r.times++;
        cx.svr.SvrArea.getGraphs({_major: e, _minor: 0, ids: a.toString}, function (e, t) {
            for (var a = 0; a < t.length; a++)n.push(t[a]);
            r.curTimes++;
            r.start()
        })
    };
    var i = function (e, t, a) {
        this.fromDbGra(e, t, a, this.graPnt)
    };
    var o = function (e, t, a) {
        this.fromDbGra(e, t, a, this.graLin)
    };
    var c = function (e, t, a) {
        var n = this;
        n.fromDbGra(e, t, a, n.graPnt);
        n.times++;
        cx.svr.SvrArea.getTopGraph({_major: e, _minor: 0, id: a}, function (e, t) {
            for (var a = 0; a < t.length; a++)n.graLin.push(t[a]);
            n.curTimes++;
            n.start()
        })
    };
    var s = function (e, t, a) {
        this.fromDbGra(e, t, a, this.graAtt)
    };
    var l = function (e, t, a) {
        this.fromDbAtt(e, t, a);
        this.fromDbGraPnt(e, t, a)
    };
    var d = function (e, t, a) {
        this.fromDbAtt(e, t, a);
        this.fromDbGraLin(e, t, a)
    };
    var u = function (e, t, a) {
        var n = this;
        n.fromDbGra(e, t, a, n.graPnt);
        n.fromDbAtt(e, t, a);
        n.times++;
        cx.svr.SvrArea.getTopGraph({_major: e, _minor: 0, id: a}, function (e, t) {
            for (var a = 0; a < t.length; a++) {
                n.graLin.push(t[a]);
                n.fromDbAtt(cx.major.LINE, t[a].minor, t[a].id);
                if (!n.noAid) {
                    n.fromDbLabel(cx.major.LINE, t[a].minor, t[a].id);
                    n.fromDbAttach(cx.major.LINE, t[a].minor, t[a].id)
                }
            }
            n.curTimes++;
            n.start()
        })
    };
    var f = function (e, t, a) {
        var n = this;
        var r = {_major: e, _minor: t, ids: a.toString()};
        n.times++;
        cx.svr.SvrStat.getAttach(r, function (e, t) {
            var a = t[cx.major.POINT] || [];
            for (var r = a.length - 1; r >= 0; r--) {
                n.fromDbAtt(a[r].major, a[r].minor, a[r].id);
                n.fromDbGraAttach(a[r].major, a[r].minor, a[r].id)
            }
            n.curTimes++;
            n.start()
        })
    };
    var v = function (e, t, a) {
        var n = this;
        var r = {cmd: "queryByGl", _major: cx.major.LABEL, _minor: 0, maj: e, min: t, gl: a};
        cx.ajax.post(cx.app.svr.Area.url(), r, 0, function (e, t) {
            for (var a = 0, r = t.length; a < r; a++) {
                n.label.push(t[a])
            }
        })
    };
    var g = function (e, t, a) {
        for (var n = 0, r = this.label.length; n < r; n++) {
            if (this.label[n].minor == t && this.label[n].gl == a) {
                return this.label[n]
            }
        }
    };
    var h = function (e, t, a) {
        this.atts.push({major: e, minor: t, att: a})
    };
    var x = function (e) {
        this.graPnt.push(e)
    };
    var m = function (e) {
        this.graLin.push(e)
    };
    var p = function (e, t, a) {
        var n;
        for (var r = this.atts.length - 1; r >= 0; r--) {
            n = this.atts[r];
            if (n.major == e && n.minor == t && n.att.id == a)return n.att
        }
        return null
    };
    var b = function () {
        return this.graPnt
    };
    var y = function () {
        return this.graLin
    };
    var w = function (e, t, a, n) {
        var r;
        for (var i = 0; i < this.atts.length; i++) {
            r = this.atts[i];
            if (r.major == e && r.att.id == a) {
                r.id = n;
                r.att.id = n
            }
        }
    };
    var C = function (e, t, a) {
        if (e) {
            for (var n = e.length - 1; n >= 0; n--) {
                if (e[n].id == t) e[n].id = a
            }
        }
    };
    var D = function (e, t, a) {
        if (e) {
            for (var n = e.length - 1; n >= 0; n--) {
                if (e[n].fntid == t) e[n].fntid = a;
                if (e[n].talid == t) e[n].talid = a
            }
        }
    };
    var S = function (e, t, a) {
        if (e) {
            for (var n = e.length - 1; n >= 0; n--) {
                if (e[n].gl == t) e[n].gl = a
            }
        }
    };
    var O = function (e, t, a) {
        this.replaceIdAttach(e, t, a)
    };
    var I = function (e, t, a, n) {
        this.replaceIdAtt(e, t, a, n);
        if (e == 1) {
            this.replaceIdGra(this.graPnt, a, n);
            this.replaceIdLin(this.graLin, a, n)
        } else if (e == 2) {
            this.replaceIdGra(this.graLin, a, n)
        }
        this.replaceIdAttach(this.graAtt, a, n);
        this.replaceIdLabel(this.label, a, n)
    };
    var T = e.prototype;
    T.start = t;
    T.fromDbAtt = a;
    T.fromDbGra = n;
    T.fromDbGras = r;
    T.fromDbGraPnt = i;
    T.fromDbGraLin = o;
    T.fromDbGraPntTop = c;
    T.fromDbGraAttach = s;
    T.fromDbPnt = l;
    T.fromDbLin = d;
    T.fromDbPntTop = u;
    T.fromDbAttach = f;
    T.fromDbLabel = v;
    T.getLabels = g;
    T.saveAtt = h;
    T.saveGraPnt = x;
    T.saveGraLin = m;
    T.getAtt = p;
    T.getPnts = b;
    T.getLins = y;
    T.replaceIdAtt = w;
    T.replaceIdGra = C;
    T.replaceIdLin = D;
    T.replaceIdAttach = S;
    T.replaceIdLabel = O;
    T.replaceId = I;
    return e
}();
namespace("cx.undo.Step");
cx.undo.Step = function () {
    var e = function (e) {
        var t = this;
        e = e || {};
        t.stepId = 0;
        t.dataOld = new cx.undo.Data({readyCall: new Caller(t, "readyData"), noAid: e.noAid});
        t.dataNew = new cx.undo.Data;
        t.major = 0;
        t.minor = 0;
        t.id = 0;
        t.time = new Date;
        t.readyCall = e.readyCall
    };
    var t = function () {
        this.readyCall = null;
        this.dataNew = null;
        this.dataOld = null
    };
    var a = function (e) {
        this.stepId = e
    };
    var n = function () {
        return this.stepId
    };
    var r = function () {
        return cx.date.formatTime(this.time)
    };
    var i = function () {
        return ""
    };
    var o = function () {
        return !1
    };
    var c = function () {
    };
    var s = function (e, t, a) {
        this.major = e;
        this.minor = t;
        this.id = a
    };
    var l = function () {
        this.dataOld.start()
    };
    var d = function () {
    };
    var u = function (e, t, a, n) {
        if (e == this.major && a == this.id) {
            this.id = n
        }
        this.dataOld.replaceId(e, t, a, n);
        this.dataNew.replaceId(e, t, a, n)
    };
    var f = function (e, t, a, n) {
    };
    var v = function (e) {
        this.data = e
    };
    var g = function () {
        return this.data
    };
    var h = function () {
        if (!gObj.progressbar) {
            gObj.progressbar = new cx.ctrl.ProgressBar({title: gLoc ? "正在处理..." : "Backupping...", closable: !0})
        }
        gObj.progressbar.create()
    };
    var x = function () {
        if (gObj.progressbar) gObj.progressbar.destroy()
    };
    var m = function () {
        if (this.readyCall) {
            this.readyCall.call()
        }
    };
    var p = e.prototype;
    p.destroy = t;
    p.setStepId = a;
    p.getStepId = n;
    p.getTime = r;
    p.getTitle = i;
    p.canSkip = o;
    p.detail = c;
    p.backup = s;
    p.start = l;
    p.undo = d;
    p.readyData = m;
    p.replaceId = u;
    p.publishReplId = f;
    p.setData = v;
    p.getData = g;
    p.proBarBegin = h;
    p.proBarEnd = x;
    return e
}();
namespace("cx.undo.Manager");
cx.undo.Manager = function () {
    var e = function (e) {
        this.id = 1;
        this.steps = new cx.frm.Stack(e);
        this.init()
    };
    var t = function () {
    };
    var a = function () {
        gObj.observer.unsubscribe(this);
        this.steps = null
    };
    var n = function () {
        return this.steps.size()
    };
    var r = function (e) {
        if (e && e instanceof cx.undo.Step) {
            e.setStepId(this.id++);
            this.steps.push(e);
            gObj.observer.publish("UndoAdd", e)
        }
    };
    var i = function () {
        this.steps.pop()
    };
    var o = function () {
        var e = this.steps.pop();
        if (e) {
            gObj.observer.publish("UndoDel", e);
            e.undo();
            e = null
        }
    };
    var c = function (e) {
        var t = this.getAll();
        var a;
        for (var n = t.length - 1; n >= 0; n--) {
            a = t[n];
            if (a.stepId == e)return a
        }
        return null
    };
    var s = function () {
        return this.steps.getTop()
    };
    var l = function () {
        return this.steps.getAll()
    };
    var d = function (e, t, a, n) {
        var r = this.steps.getAll();
        for (var i = 0; i < r.length; i++) {
            r[i].replaceId(e, t, a, n)
        }
    };
    var u = e.prototype;
    u.init = t;
    u.destroy = a;
    u.size = n;
    u.push = r;
    u.pop = i;
    u.undo = o;
    u.get = c;
    u.getTop = s;
    u.getAll = l;
    u.replaceId = d;
    return e
}();
namespace("cx.undo.AttDelete");
cx.undo.AttDelete = function () {
    var e = function (e) {
        cx.base(this, e)
    };
    var t = function () {
        var e = gObj.entity.byMajorMinor(this.major, this.minor);
        if (e) {
            return gLoc ? "删除 - " + e.namec : "Delete - " + e.namee
        }
        return ""
    };
    var a = function (e, t, a) {
        cx.base(this, "backup", e, t, a);
        this.dataOld.fromDbAtt(e, t, a);
        this.start()
    };
    var n = function () {
        var e = this;
        var t;
        t = e.dataOld.getAtt(e.major, e.minor, e.id);
        gObj.attOper.insert(e.major, e.minor, t, new Caller(function (t) {
            e.publishReplId(e.major, e.minor, e.id, t.id)
        }))
    };
    var r = function () {
        var e = this;
        var t;
        t = e.dataOld.getAtt(e.major, e.minor, e.id);
        cx.network.Tool.dispAtt(e.major, e.minor, t)
    };
    cx.inherits(e, cx.undo.Step);
    var i = e.prototype;
    i.getTitle = t;
    i.backup = a;
    i.undo = n;
    i.detail = r;
    return e
}();
namespace("cx.undo.AttInsert");
cx.undo.AttInsert = function () {
    var e = function (e) {
        cx.base(this, e)
    };
    var t = function () {
        var e = gObj.entity.byMajorMinor(this.major, this.minor);
        if (e) {
            return gLoc ? "增加 - " + e.namec : "Insert - " + e.namee
        }
        return ""
    };
    var a = function (e, t, a) {
        cx.base(this, "backup", e, t, a);
        this.start()
    };
    var n = function () {
        var e = this;
        var t;
        t = e.dataNew.getAtt(e.major, e.minor, e.id);
        gObj.attOper.del(e.major, e.minor, e.id, t, null)
    };
    var r = function () {
        var e = this;
        var t;
        t = e.dataNew.getAtt(e.major, e.minor, e.id);
        RunPlugin("AttDisp", {major: e.major, minor: e.minor, att: t})
    };
    cx.inherits(e, cx.undo.Step);
    var i = e.prototype;
    i.getTitle = t;
    i.backup = a;
    i.undo = n;
    i.detail = r;
    return e
}();
namespace("cx.undo.AttInsertFile");
cx.undo.AttInsertFile = function () {
    var e = function (e) {
        cx.base(this, e)
    };
    var t = function () {
        var e = gObj.entity.byMajorMinor(this.major, this.minor);
        if (e) {
            return gLoc ? "增加 - " + e.namec : "Insert - " + e.namee
        }
        return ""
    };
    var a = function (e, t, a) {
        cx.base(this, "backup", e, t, a);
        this.start()
    };
    var n = function () {
        var e = this;
        var t;
        t = e.dataNew.getAtt(e.major, e.minor, e.id);
        gObj.attOper.del_File(e.major, e.minor, e.id, t, null)
    };
    var r = function () {
        var e = this;
        var t;
        t = e.dataNew.getAtt(e.major, e.minor, e.id);
        RunPlugin("AttDisp", {major: e.major, minor: e.minor, att: t})
    };
    cx.inherits(e, cx.undo.Step);
    var i = e.prototype;
    i.getTitle = t;
    i.backup = a;
    i.undo = n;
    i.detail = r;
    return e
}();
namespace("cx.undo.AttUpdate");
cx.undo.AttUpdate = function () {
    var e = function (e) {
        cx.base(this, e)
    };
    var t = function () {
        var e = gObj.entity.byMajorMinor(this.major, this.minor);
        if (e) {
            return gLoc ? "修改 - " + e.namec : "Update - " + e.namee
        }
        return ""
    };
    var a = function (e, t, a) {
        cx.base(this, "backup", e, t, a);
        this.dataOld.fromDbAtt(e, t, a);
        this.start()
    };
    var n = function () {
        var e = this;
        var t = e.dataOld.getAtt(e.major, e.minor, e.id);
        var a = e.dataNew.getAtt(e.major, e.minor, e.id);
        gObj.attOper.update(e.major, e.minor, e.id, t, a, null)
    };
    var r = function () {
        var e = this;
        var t = e.dataOld.getAtt(e.major, e.minor, e.id);
        var a = e.dataNew.getAtt(e.major, e.minor, e.id);
        var n = {major: e.major, minor: e.minor, oldAtt: t, newAtt: a, widthKey: null, widthVal: null};
        RunPlugin("AttDiff", n)
    };
    var i = function () {
        return !0
    };
    cx.inherits(e, cx.undo.Step);
    var o = e.prototype;
    o.getTitle = t;
    o.backup = a;
    o.undo = n;
    o.detail = r;
    o.canSkip = i;
    return e
}();
cx.ctrl.IControl = function () {
    var e = function (e) {
        this.data = {};
        cx.extend(this.data, e);
        this.target = null
    };
    var t = function (e) {
    };
    var a = function () {
        if (this.target) {
            cx.dom.remove(this.target);
            this.target = null
        }
    };
    var n = function (e) {
        for (var t in e) {
            this.prototype[t] = e[t]
        }
    };
    var r = function (e) {
        for (var t in e) {
            this.prototype[t] = null
        }
    };
    var i = function () {
        cx.dom.setVisible(this.target, !0)
    };
    var o = function () {
        cx.dom.setVisible(this.target, !1)
    };
    var c = function (e) {
    };
    var s = function (e) {
    };
    var l = function () {
        return this.val()
    };
    var d = function (e) {
        this.val(e)
    };
    var u = e.prototype;
    u.create = t;
    u.destroy = a;
    u.bind = n;
    u.unbind = r;
    u.show = i;
    u.hide = o;
    u.val = c;
    u.readonly = s;
    u.setValue = l;
    u.setValue = d;
    return e
}();
cx.ctrl.AttSearch = function () {
    var e = function (e) {
        cx.base(this, e);
        this._fltPara = e.filterPara
    };
    var t = function () {
        var e, t;
        t = cx.dom.create("div", "w_100p h_100p of_a ta_l", this.domNode, null);
        this.flds = cx.array.gets(this.flds, this._fltPara);
        var a = cx.util.copyArray2(this.flds);
        for (var n = 0; n < a.length; n++) {
            e = a[n];
            e.newedit = 1;
            e.editable = 1;
            if (e.disporder < 1)continue;
            this.dispFld(t, e, this.att[e.colname])
        }
    };
    var a = function (e, t, a) {
        var n = cx.dom.create("table", "tableUiInfo d_ib", e, null);
        var r = cx.dom.create("tr", null, n, null);
        var i = cx.dom.create("td", "cx-td-keycol", r, {innerHTML: (gLoc ? t.namec : t.namee) + ":"});
        if (this.widthKey && this.widthKey != "") i.style.width = this.widthKey;
        var o = cx.dom.create("td", null, r, null);
        var c = cx.dom.create("div", null, o, null);
        var s = "125px";
        switch (t.disptype) {
            default:
            case 1:
                if (t.disprows <= 1) this.dispTextBox(t, s, c, a); else this.dispTextArea(t, s, c, a);
                break;
            case 2:
                this.dispDropdown(t, s, c, a);
                break;
            case 6:
                this.dispDropdown(t, s, c, a);
                break;
            case 3:
                this.dispDate(t, s, c, a);
                break;
            case 7:
                this.dispValButton(t, s, c, a);
                break
        }
    };
    var n = function () {
        var e = this.flds;
        var t = {};
        for (var a = 0; a < e.length; a++) {
            var n = e[a];
            t[n.colname] = ""
        }
        return t
    };
    var r = function () {
        var e = this.flds;
        var t = {};
        var a;
        for (a = 0; a < e.length; a++) {
            var n = e[a];
            if (n.disporder < 1)continue;
            t[n.colname] = this.getFldValue(n.colname)
        }
        for (a in this.att) {
            if (t[a] === void 0 || !t[a]) t[a] = this.att[a]
        }
        return t
    };
    var i = function (e) {
        var t = gObj.field.getFldvalues(this._tabname, e);
        if (t && t.length > 0)return t
    };
    var o = function (e) {
        var t = !0;
        var a;
        var n;
        for (var r = 0; r < this.flds.length; r++) {
            a = this.flds[r];
            if (a.disporder < 1)continue;
            n = e[a.colname];
            if (a.isnum != 0) {
                if (n != "") {
                    if (cx.number.is(n) != !0) {
                        cx.msg.dispErrCode("errFldNumber", gLoc ? a.namec : a.namee);
                        return !1
                    }
                }
            } else {
                if (a.disptype == 3) {
                    if (n != "") {
                        t = cx.date.isDate(n);
                        if (!t) {
                            cx.msg.dispErrCode("errFldDate", gLoc ? a.namec : a.namee);
                            break
                        }
                    }
                }
            }
        }
        return t
    };
    cx.inherits(e, cx.frm.AttBase);
    var c = e.prototype;
    c.getVal = r;
    c.getDefVal = n;
    c.getFldOpts = i;
    c.dispFld = a;
    c.disp = t;
    c.checkInput = o;
    return e
}();
cx.ctrl.Bubble = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {};
        cx.extend(t.data, e);
        t.wndCont = null;
        t.wndHandleL = null;
        t.wndHandleS = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-bubble";
        var r;
        var i;
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n);
            r = cx.parser.getChildren(t.target)
        } else {
            var o = {};
            if (a.id) o.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, o)
        }
        t.target.wnd = t;
        t.wndCont = cx.dom.create("div", "bubble-cont", t.target, null);
        t.wndHandleL = cx.dom.create("div", "bubble-handle-large", t.target, null);
        t.wndHandleS = cx.dom.create("div", "bubble-handle-small", t.target, null);
        if (e) {
            for (i = 0; i < r.length; i++) {
                t.wndCont.appendChild(r[i])
            }
        } else {
            if (a.content) {
                cx.dom.setInnerHTML(t.wndCont, a.content)
            }
        }
        t.resize()
    };
    var a = function () {
        return this.wndConts
    };
    var n = function (e) {
        cx.dom.setContent(this.wndCont, e)
    };
    var r = function () {
        var e = cx.dom.getSize(this.target);
        var t = e.w / 2;
        var a = 12;
        this.wndHandleL.style.left = t - a + "px";
        this.wndHandleS.style.left = t - a + 1 + "px"
    };
    cx.inherits(e, cx.ctrl.IControl);
    var i = e.prototype;
    i.create = t;
    i.domCont = a;
    i.setContent = n;
    i.resize = r;
    return e
}();
cx.ctrl.Button = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {};
        cx.extend(t.data, e)
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-button";
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n);
            var r = {};
            if (a.iconCls && a.iconCls != "") r.iconCls = a.iconCls;
            $(t.target).linkbutton(r)
        }
        var i = function (e) {
            e.preventDefault();
            if (a.plugin && a.plugin != "") {
                var t = 1;
                var n = {};
                for (var r in a) {
                    n[r] = a[r];
                    if (cx.isStr(a[r]) && a[r] != "" && cx.regex.refVariable.test(a[r])) {
                        var i = a[r].match(cx.regex.refVariable);
                        n[r] = cx.frm.FormAtt.getValue(i[1]);
                        if (!n[r] || n[r] == "") {
                            t = 0;
                            break
                        }
                    }
                }
                if (!t)return;
                RunPlugin(a.plugin, n)
            }
        };
        $(t.target).bind("click", i)
    };
    cx.inherits(e, cx.ctrl.IControl);
    var a = e.prototype;
    a.create = t;
    return e
}();
cx.ctrl.DataGrid = function () {
    var e = function (e) {
        var t = this;
        e = e || {};
        t.grid = null;
        t.toolbarArr = null;
        t.pagelist = e.pagelist || [5, 10, 20, 30, 50];
        t.pageno = e.pageno || 1;
        t.pagesize = e.pagesize || 20;
        t.totalnum = e.totalnum || 0;
        t.checkOnSelect = cx.isNNull(e.checkOnSelect) ? !!e.checkOnSelect : !0;
        t.selectOnCheck = cx.isNNull(e.selectOnCheck) ? !!e.selectOnCheck : !0;
        t.checkbox = cx.isNNull(e.checkbox) ? !!e.checkbox : !0;
        t.singleSelect = cx.isNNull(e.singleSelect) ? !!e.singleSelect : !1;
        t.onSelectPage = cx.isFunc(e.onSelectPage) ? e.onSelectPage : function () {
        };
        t.idField = e.idField || "id";
        t.structure = cx.isArr(e.structure) ? e.structure : [];
        t.domNode = e.domNode || "";
        t.onSelectionChanged = cx.isFunc(e.onSelectionChanged) ? e.onSelectionChanged : function () {
        };
        t.onDblClick = e.onDblClick;
        t.onCheckNode = e.onCheckNode;
        t.onUnCheckNode = e.onUnCheckNode;
        t.onCheckNodeAll = e.onCheckNodeAll;
        t.onUnCheckNodeAll = e.onUnCheckNodeAll;
        t.onClickCell = e.onClickCell;
        t.navflag = !!e.navflag;
        t.funcTool = cx.isArr(e.funcTool) ? e.funcTool : [];
        t.onSortCol = cx.isFunc(e.onSortCol) ? e.onSortCol : function () {
        };
        t.onRowStyle = cx.isFunc(e.onRowStyle) ? e.onRowStyle : function () {
        };
        var a = cx.isDef(e.pConCls) ? e.pConCls : "full_0";
        t.wnd = cx.dom.create("div", a, e.domNode, null);
        t.setTotalPage();
        t.convertData(e.data);
        t.createFuncTool();
        t.create();
        t.createPagination()
    };
    var t = function () {
        if (this.wnd) {
            cx.dom.empty(this.wnd);
            this.wnd = null
        }
    };
    var a = function () {
        var e = this;
        var t = $("<div class='easyui-datagrid'></div>").appendTo($(this.wnd));
        var a = {
            idField: e.idField,
            data: e.storeData,
            fit: !0,
            columns: e.structure,
            rownumbers: !0,
            singleSelect: e.singleSelect,
            selectOnCheck: e.selectOnCheck,
            checkOnSelect: e.checkOnSelect,
            pagination: e.navflag,
            toolbar: e.toolbarArr,
            onSelect: function (t, a) {
                e.rowselIndex = t
            },
            onClickRow: e.onSelectionChanged,
            onDblClickRow: e.onDblClick,
            onClickCell: this.onClickCell,
            onCheck: e.onCheckNode,
            onCheckAll: e.onCheckNodeAll ? e.onCheckNodeAll : e.onCheckNode,
            onUncheckAll: e.onUnCheckNodeAll ? e.onUnCheckNodeAll : e.onCheckNode,
            onUncheck: e.onUnCheckNode ? e.onUnCheckNode : e.onCheckNode,
            onSortColumn: e.onSortCol,
            rowStyler: e.onRowStyle
        };
        if (e.checkbox) a.frozenColumns = [[{field: "", checkbox: e.checkbox}]];
        e.grid = $(t).datagrid(a)
    };
    var n = function (e) {
        this.storeData = this.totalnum > 0 ? {total: this.totalnum, rows: e} : e
    };
    var r = function () {
        var e = this;
        if (e.grid) {
            var t = e.grid.datagrid("getPager");
            $(t).pagination({
                pageList: e.pagelist, pageSize: e.pagesize, onSelectPage: function (t, a) {
                    e.onSelectPage(t, a)
                }, onRefresh: function (e, a) {
                    $(t).pagination("select", e)
                }
            })
        }
    };
    var i = function () {
        var e = this;
        e.toolbarArr = [];
        if (e.funcTool.length != 0) {
            for (var t = 0; t < e.funcTool.length; t++) {
                var a = this.funcTool[t];
                (function () {
                    var t = a;
                    e.toolbarArr.push({
                        id: t.id + e.domNode.id,
                        iconCls: t.idIcon,
                        text: t.label,
                        disabled: t.access == 0 ? !1 : !0,
                        handler: function () {
                            if (t.callFunc) {
                                t.callFunc.call()
                            }
                        }
                    })
                })()
            }
        }
    };
    var o = function () {
        var e = [];
        var t = {label: "", value: ""};
        e.push(t);
        for (var a = 0; a < this.pagelist.length; a++) {
            t = {label: this.pagelist[a].toString(), value: this.pagelist[a].toString()};
            e.push(t)
        }
        return e
    };
    var c = function (e) {
        if (!!e) {
            this.structure = e;
            this.grid.datagrid({columns: this.structure})
        }
    };
    var s = function (e) {
        this.convertData(e);
        this.grid.datagrid("loadData", this.storeData)
    };
    var l = function (e) {
        this.grid.datagrid("selectRow", e)
    };
    var d = function (e) {
        return this.grid.datagrid("getRowIndex", e.id)
    };
    var u = function () {
        var e = this.grid.datagrid("getSelections");
        this.enableFuncBtn(this.funcTool, e.length);
        return e
    };
    var f = function () {
        var e = this.grid.datagrid("getChecked");
        this.enableFuncBtn(this.funcTool, e.length);
        return e
    };
    var v = function (e) {
        this.totalnum = e
    };
    var g = function () {
        this.totalpage = Math.ceil(this.totalnum / this.pagesize);
        if (this.totalpage == 0) {
            this.totalpage = 1
        }
    };
    var h = function (e, t) {
        if (e.length != 0) {
            for (var a = 0; a < e.length; a++) {
                var n = e[a];
                var r = n.access;
                var i = n.id + this.domNode.id;
                var o = $("#" + i);
                var c = o.length;
                $("#" + i).linkbutton("disable");
                if (r == "0") {
                    $("#" + i).linkbutton("enable")
                }
                if (r == "n" && t > 0) {
                    $("#" + i).linkbutton("enable")
                }
                if (r == "1" && t == 1) {
                    $("#" + i).linkbutton("enable")
                }
            }
        }
    };
    var x = e.prototype;
    x.destroy = t;
    x.create = a;
    x.convertData = n;
    x.createPagination = r;
    x.createFuncTool = i;
    x.setPageList = o;
    x.setStructure = c;
    x.setStore = s;
    x.setSelectRow = l;
    x.getSelectRow = d;
    x.getSelected = u;
    x.getChecked = f;
    x.setTotalNum = v;
    x.setTotalPage = g;
    x.enableFuncBtn = h;
    return e
}();
cx.moveWinNoBody = !0;
cx.noWinShadow = !1;
cx.ctrl.Dialog = function () {
    var e = function (e) {
        var t = this;
        t.data = {modal: !1, alignH: 0, alignV: 0, margin: 5, visible: !0};
        cx.extend(t.data, e);
        t.wndShadow = null;
        t.wndModal = null;
        t.wndDlg = null;
        t.wndTitle = null;
        t.wndName = null;
        t.wndClose = null;
        t.wndMin = null;
        t.wndContBg = null;
        t.wndCont = null;
        t.wndCmd = null;
        t.wndResize = null;
        t.moveObj = null;
        t.resizeObj = null;
        t.btnDown = !1;
        t.minimized = !1;
        t.needResize = !1
    };
    var t = function () {
        var e = cx.nextZIndex();
        if (this.data.modal) e = e + 1e3;
        cx.nextZIndex();
        cx.nextZIndex();
        return e
    };
    var a = function (e) {
        var t = 20;
        var a = cx.window.getClientSize();
        var n = t, r = t;
        switch (e.alignH) {
            case-1:
                n = t;
                break;
            case 0:
                n = (a.w - e.width) / 2;
                break;
            case 1:
                n = a.w - e.width - t;
                break
        }
        switch (e.alignV) {
            case 1:
                r = t;
                break;
            case 0:
                r = (a.h - e.height) / 2;
                break;
            case-1:
                r = a.h - e.height - t;
                break
        }
        if (r < t) r = t;
        return {x: n, y: r}
    };
    var n = function () {
        var e = this;
        var t = e.data;
        var n = e.getZIndex();
        e.needResize = !t.visible;
        var r = a(t);
        var i = "left:" + r.x + "px;top:" + r.y + "px;width:" + t.width + "px;height:" + t.height + "px;";
        if (!cx.noWinShadow) {
            e.wndShadow = new cx.ctrl.Shadow({visible: t.visible, style: i + "z-index:" + n});
            e.wndShadow.create()
        }
        if (t.modal) {
            e.wndModal = cx.dom.create("div", "cx-dlg-modal", cx.dom.body(), {style: "z-index:" + (n + 1)})
        }
        e.wndDlg = cx.dom.create("div", "cx-win cx-shadow-rb" + (!e.data.visible ? " hide" : ""), cx.dom.body(), {style: i + "z-index:" + (n + 2)});
        e.wndDlg.wnd = e;
        if (t.id) e.wndDlg.id = t.id;
        e.wndTitle = cx.dom.create("div", "w-title", e.wndDlg, null);
        if (!t.icon || t.icon == "") t.noIcon = !0;
        var o = null;
        if (!t.noIcon) {
            o = cx.dom.create("div", "w-icon " + cx.path.get16Icon(t.icon), e.wndTitle, null)
        }
        e.wndName = cx.dom.create("div", "w-name", e.wndTitle, null);
        if (t.closable || !t.noClose) {
            t.noClose = !1;
            e.wndClose = cx.dom.create("div", "w-close", e.wndTitle, null)
        }
        if (t.modal) t.noMin = !0;
        if (!t.noMin) {
            e.wndMin = cx.dom.create("div", "w-min", e.wndTitle, null)
        }
        e.wndContBg = cx.dom.create("div", "w-cont-bg", e.wndDlg, null);
        e.wndCont = cx.dom.create("div", "w-cont of_h", e.wndContBg, null);
        if (t.heightCmd) {
            e.wndCont.style.bottom = t.heightCmd + 5 + 1 + "px"
        }
        if (t.heightCmd) {
            e.wndCmd = cx.dom.create("div", "w-cmd", e.wndContBg, {id: t.id + "Cmd"})
        }
        if (!t.noSize) {
            e.wndResize = cx.dom.create("div", "w-resize", e.wndContBg, null)
        }
        if (e.wndClose) {
            e.wndClose.onmousedown = function (t) {
                t.preventDefault();
                e.close(!0)
            }
        }
        if (e.wndMin) {
            e.wndMin.onmousedown = function (t) {
                t.preventDefault();
                e.minimize()
            };
            e.wndMin.onmouseup = function (e) {
                e.preventDefault()
            }
        }
        e.wndTitle.onmousedown = function (t) {
            if (!e.minimized) {
                t.preventDefault();
                e.btnDown = !0
            }
        };
        e.wndTitle.onmousemove = function (t) {
            t.preventDefault();
            if (e.btnDown) {
                e.moveObj = new cx.ctrl.DomMove(e, e.wndDlg, t.clientX, t.clientY);
                e.moveObj.create();
                e.btnDown = !1
            }
        };
        e.wndTitle.onmouseup = function (t) {
            t.preventDefault();
            e.btnDown = !1;
            e.wndDlg.style.zIndex = e.wndModal ? e.wndModal.style.zIndex : cx.nextZIndex()
        };
        if (e.wndResize) {
            e.wndResize.onmousedown = function (t) {
                t.preventDefault();
                e.resizeObj = new cx.ctrl.DomResize(e, t.clientX, t.clientY);
                e.resizeObj.create()
            }
        }
        e.wndName.innerHTML = t.title;
        if (t.content && t.content != "") {
            e.setContent(t.content)
        }
        if (t.url && t.url != "") {
            e.setHref(t.url)
        }
    };
    var r = function () {
        var e = this;
        cx.dom.clearEasyUi(e.wndCont);
        if (e.wndDlg) {
            e.wndDlg.wnd = null;
            cx.dom.body().removeChild(e.wndDlg)
        }
        if (e.wndModal) {
            cx.dom.body().removeChild(e.wndModal)
        }
        if (e.wndShadow) {
            e.wndShadow.destroy()
        }
        e.wndResize = null;
        e.wndCmd = null;
        e.wndCont = null;
        e.wndContBg = null;
        e.wndName = null;
        e.wndTitle = null;
        e.wndDlg = null;
        e.wndModal = null;
        e.wndShadow = null
    };
    var i = function () {
        this.close(!1)
    };
    var o = function (e) {
        if (gObj.observer) gObj.observer.publish("DialogClose", this);
        if (this.data.onClose) {
            this.data.onClose.call(e)
        }
        this.destroy()
    };
    var c = function () {
        this.btnDown = !1;
        if (this.moveObj) this.moveObj = null
    };
    var s = function () {
        if (this.resizeObj) this.resizeObj = null
    };
    var l = function () {
        return this.wndCont
    };
    var d = function () {
        return this.wndCmd
    };
    var u = function (e, t) {
        var a = this;
        var n = a.data;
        var r = {width: e + "px", height: t + "px"};
        if (a.wndShadow) a.wndShadow.setStyle(r);
        cx.dom.setStyle(a.wndDlg, r);
        if (gObj.observer) gObj.observer.publish("DialogResize", a);
        n.width = e;
        n.height = t;
        cx.layout.resize(a.wndCont)
    };
    var f = function () {
        return {width: this.data.width, height: this.data.height}
    };
    var v = function (e, t) {
        var a = this.data;
        var n = a.margin;
        var r = 24;
        this.setSize(e + n * 2, t + r + n * 2)
    };
    var g = function (e, t) {
        var a = this.data;
        var n = cx.window.getClientSize();
        if (t + a.height > n.h) t = n.h - a.height;
        if (e + a.width > n.w) e = e - a.width;
        this.moveTo(e, t)
    };
    var h = function (e, t) {
        var a = {left: e + "px", top: t + "px"};
        if (this.wndShadow) this.wndShadow.setStyle(a);
        cx.dom.setStyle(this.wndDlg, a);
        cx.layout.resize(this.wndCont)
    };
    var x = function (e) {
        this.wndName.innerHTML = e;
        this.data.title = e
    };
    var m = function () {
        return this.data.title
    };
    var p = function () {
        return this.data.icon
    };
    var b = function (e) {
        var t = this.data;
        if (e && e != "") {
            cx.ajax.loadHtml({url: e, dom: this.wndCont, onLoad: t.onLoad, onReplaceId: t.onReplaceId})
        }
    };
    var y = function (e) {
        cx.dom.setContent(this.wndCont, e);
        if (this.data.onLoad) this.data.onLoad.call()
    };
    var w = function () {
        var e = this;
        if (gObj.observer) gObj.observer.publish("DialogShow", e);
        var t;
        if (e.wndModal) {
            t = parseInt(this.wndModal.style.zIndex);
            if (e.wndShadow) e.wndShadow.setStyle({zIndex: t - 1});
            cx.dom.setStyle(e.wndDlg, {zIndex: t + 1})
        } else {
            t = this.getZIndex();
            if (e.wndShadow) e.wndShadow.setStyle({zIndex: t});
            cx.dom.setStyle(e.wndDlg, {zIndex: t + 1})
        }
        if (e.wndShadow) e.wndShadow.show();
        if (e.wndModal) cx.dom.setVisible(e.wndModal, !0);
        cx.dom.setVisible(e.wndDlg, !0);
        e.setSize(this.data.width, e.data.height);
        if (e.needResize) {
            e.needResize = !1;
            cx.layout.resize(e.wndCont)
        }
        e.minimized = !1
    };
    var C = function () {
        cx.dom.setVisible(this.wndDlg, !1);
        if (this.wndModal) cx.dom.setVisible(this.wndModal, !1);
        if (this.wndShadow) this.wndShadow.hide()
    };
    var D = function () {
        this.minimized = !0;
        if (gObj.observer) gObj.observer.publish("DialogMin", this);
        cx.dom.setVisible(this.wndDlg, !1);
        if (this.wndModal) cx.dom.setVisible(this.wndModal, !1);
        if (this.wndShadow) this.wndShadow.hide()
    };
    var S = function (e, t) {
        if (e == "title") {
            this.setTitle(t)
        } else if (e == "href") {
            this.setHref(t)
        }
    };
    var O = e.prototype;
    O.getZIndex = t;
    O.create = n;
    O.destroy = r;
    O.destroySelf = i;
    O.close = o;
    O.endMove = c;
    O.endResize = s;
    O.domCont = l;
    O.domCmd = d;
    O.setSize = u;
    O.getSize = f;
    O.setSizeCont = v;
    O.fitPos = g;
    O.moveTo = h;
    O.setTitle = x;
    O.getTitle = m;
    O.getIcon = p;
    O.setHref = b;
    O.setContent = y;
    O.show = w;
    O.hide = C;
    O.minimize = D;
    O.set = S;
    return e
}();
cx.ctrl.DomMove = function () {
    var e = function (e, t, a, n) {
        var r = this;
        r.wnd = e;
        r.obj = t;
        r.ox = parseInt(t.style.left);
        r.oy = parseInt(t.style.top);
        r.mx = a;
        r.my = n;
        r.shadow = null;
        r.div = null;
        r.mark = null
    };
    var t = function () {
        var e = this;
        var t = cx.nextZIndex() + 1e3;
        if (cx.moveWinNoBody) {
            var a = cx.dom.getPosSize(e.obj);
            if (cx.noWinShadow) {
                e.wndShadow = new cx.ctrl.Shadow({style: "left:" + a.x + "px;top:" + a.y + "px;width:" + a.w + "px;height:" + a.h + "px;z-index:" + t++});
                e.wndShadow.create()
            }
            e.div = cx.dom.clone(e.obj);
            cx.dom.setZIndex(e.div, t++);
            cx.dom.setVisible(e.div, !0)
        }
        e.mark = cx.dom.create("div", "cx-dlg-move", cx.dom.body(), null);
        cx.dom.setZIndex(e.mark, t++);
        e.mark.onmousemove = function (t) {
            t.preventDefault();
            if (cx.moveWinNoBody) {
                var a = {left: e.ox + t.clientX - e.mx + "px", top: e.oy + t.clientY - e.my + "px"};
                if (e.wndShadow) e.wndShadow.setStyle(a);
                cx.dom.moveTo(e.div, e.ox + t.clientX - e.mx, e.oy + t.clientY - e.my)
            } else {
                e.wnd.moveTo(e.ox + t.clientX - e.mx, e.oy + t.clientY - e.my)
            }
        };
        e.mark.onmouseup = function (t) {
            t.preventDefault();
            if (cx.moveWinNoBody) {
                e.wnd.moveTo(e.ox + t.clientX - e.mx, e.oy + t.clientY - e.my);
                cx.dom.remove(e.div);
                if (e.wndShadow) e.wndShadow.destroy()
            } else {
            }
            cx.dom.remove(e.mark);
            e.wnd.endMove();
            e.div = null;
            e.obj = null;
            e.wnd = null
        }
    };
    e.prototype.create = t;
    return e
}();
cx.ctrl.DomResize = function () {
    var e = function (e, t, a) {
        var n = this;
        n.wnd = e;
        n.ow = e.data.width;
        n.oh = e.data.height;
        n.mx = t;
        n.my = a;
        n.mark = null
    };
    var t = function () {
        var e = this;
        e.mark = cx.dom.create("div", "cx-dlg-resize", cx.dom.body(), null);
        cx.dom.setZIndex(e.mark, cx.nextZIndex() + 1e3);
        e.mark.onmouseup = function (t) {
            t.preventDefault();
            cx.dom.remove(e.mark);
            e.wnd.endResize();
            e.mark = null;
            e.wnd = null
        };
        e.mark.onmousemove = function (t) {
            t.preventDefault();
            e.wnd.setSize(e.ow + t.clientX - e.mx, e.oh + t.clientY - e.my)
        }
    };
    e.prototype.create = t;
    return e
}();
cx.ctrl.DialogCmd = function () {
    var e = function (e) {
        e = e || {};
        e.heightCmd = 32;
        cx.base(this, e)
    };
    var t = function (e) {
        if (cx.isArr(e)) {
            for (var t in e) {
                cx.domClass.add(this.domCmd(), e[t])
            }
        }
    };
    var a = function (e) {
        for (var t = 0; t < e.length; t++) {
            this.addButton(e[t])
        }
    };
    var n = function (e) {
        var t = this;
        var a = cx.dom.create("a", e.className, t.domCmd(), {innerHTML: e.label});
        $(a).linkbutton({
            iconCls: e.iconCls, disable: e.disabled, onClick: function () {
                if (e.close) t.destroySelf();
                if (e.onClick) e.onClick.call()
            }
        })
    };
    cx.inherits(e, cx.ctrl.Dialog);
    var r = e.prototype;
    r.initCmd = t;
    r.addButtons = a;
    r.addButton = n;
    return e
}();
cx.ctrl.DialogContainer = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data.position = cx.defaultValue(t.data.position, "bottom");
        t.data.direction = cx.defaultValue(t.data.direction, "right");
        t.data.sepWidth = cx.defaultValue(t.data.sepWidth, "0.125em");
        t.list = []
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-dlgcontainer";
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.domClass.add(t.target, n);
            cx.extend(t.data, cx.parser.getOptions($(t.target).attr("data-options")))
        } else {
            var r = {};
            if (a.id && a.id != "") r.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, r)
        }
        t.target.wnd = t;
        a.position = cx.consts.getPosition(a.position);
        a.direction = cx.consts.getDirection(a.direction);
        switch (a.position) {
            case 1:
            case 2:
                switch (a.direction) {
                    case 3:
                    case 4:
                        break;
                    default:
                        a.direction = 4;
                        break
                }
                break;
            case 3:
            case 4:
                switch (a.direction) {
                    case 1:
                    case 2:
                        break;
                    default:
                        a.direction = 1;
                        break
                }
                break
        }
        gObj.observer.subscribe(t, "DialogMin", new Caller(t, "add"));
        gObj.observer.subscribe(t, "DialogClose", new Caller(t, "closeDialog"));
        gObj.observer.subscribe(t, "DialogShow", new Caller(t, "closeDialog"))
    };
    var a = function () {
        gObj.observer.unsubscribe(this);
        delete this.list;
        cx.base(this, "destroy")
    };
    var n = function (e) {
        var t = this;
        var a = t.data;
        var n = "";
        switch (a.direction) {
            case 1:
                n = "margin-bottom:" + a.sepWidth;
                break;
            case 2:
                n = "margin-top:" + a.sepWidth;
                break;
            case 3:
                n = "display:inline-block;float:left;margin-right:" + a.sepWidth;
                break;
            case 4:
                n = "display:inline-block;float:right;margin-left:" + a.sepWidth;
                break
        }
        var r = cx.dom.create("div", "dlg-item", null, {style: n});
        r.dialog = e;
        switch (a.direction) {
            case 2:
                cx.dom.insertFirst(r, t.target);
                break;
            default:
                cx.dom.append(r, t.target);
                break
        }
        var i = e.getIcon();
        var o = "dlg-icon ";
        if (i && i != "") o = o + cx.path.get32Icon(i);
        cx.dom.create("div", o, r, null);
        t.list.push(r);
        r.onclick = function (t) {
            t.preventDefault();
            e.show();
            $(r).tooltip("destroy")
        };
        addTip(r, e.getTitle())
    };
    var r = function (e) {
        var t = cx.array.get1(this.list, {dialog: e});
        if (t) {
            t.dialog = null;
            cx.dom.remove(t);
            cx.array.remove(this.list, {dialog: e})
        }
    };
    cx.inherits(e, cx.ctrl.IControl);
    var i = e.prototype;
    i.create = t;
    i.destroy = a;
    i.add = n;
    i.closeDialog = r;
    return e
}();
cx.ctrl.FileList = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {uploadable: !0, viewable: !1, convert: !1};
        cx.extend(t.data, e);
        t.list = []
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-filelist";
        var r, o;
        var c;
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n);
            r = cx.parser.getChildren(t.target)
        } else {
            var s = {};
            if (a.id) s.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, s)
        }
        t.target.wnd = t;
        if (e) {
            for (c = 0; c < r.length; c++) {
                o = {isNew: !1};
                if (r[c].id) o.id = r[c].id;
                cx.extend(o, cx.parser.getOptions($(r[c]).attr("data-options")));
                t.add(o)
            }
            for (c = 0; c < r.length; c++) {
                cx.dom.remove(r[c])
            }
        }
        if (t.data.uploadable) {
            i(t)
        }
    };
    var a = function (e) {
        var t = this;
        var a = {deletable: !1, downloadable: !1, viewable: !1};
        cx.extend(a, e);
        if (!a.iconCls || a.iconCls == "") {
            var n = cx.file.type(a.filename);
            switch (n) {
                case 3:
                    a.iconCls = "iconVideo32";
                    break;
                case 4:
                    a.iconCls = "iconAudio32";
                    break;
                case 2:
                    a.iconCls = "iconImage32";
                    break;
                case 1:
                    var r = cx.file.getFileType(a.filename).toUpperCase();
                    switch (r) {
                        case"PPT":
                        case"PPTX":
                            a.iconCls = "iconPpt32";
                            break;
                        case"DOC":
                        case"DOCX":
                            a.iconCls = "iconWord32";
                            break;
                        case"XLS":
                        case"XLSX":
                            a.iconCls = "iconXls32";
                            break;
                        case"PDF":
                            a.iconCls = "iconPdf32";
                            break;
                        default:
                            a.iconCls = "iconDocOther";
                            break
                    }
                    break
            }
        }
        var i = cx.dom.create("div", "file-item", null, null);
        var o = cx.dom.create("div", "file-icon " + a.iconCls, i, null);
        var c = cx.dom.create("div", "file-title", i, null);
        var s = cx.dom.create("div", "file-text", c, {innerHTML: e.title + "<br>(" + cx.file.getFilelenStr(a.filelen) + ")"});
        if (t.cmdAdd) {
            cx.dom.insertBefore(i, t.cmdAdd)
        } else {
            cx.dom.append(i, t.target)
        }
        i.cmdBar = cx.dom.create("div", "file-cmdbar hide", i, null);
        if (a.deletable) {
            i.delCmd = cx.dom.create("div", "file-cmd iconDelete", i.cmdBar, null);
            i.delCmd.onclick = function (e) {
                e.preventDefault();
                cx.file.deleteFile(a.filename, new Caller(function (e, n) {
                    if (a.isNew) {
                        if (t.data.onDeleteNew) t.data.onDeleteNew.call(e, n)
                    } else {
                        if (t.data.onDeleteOld) t.data.onDeleteOld.call(e, n)
                    }
                    cx.array.remove(t.list, {filename: a.filename});
                    cx.dom.remove(i)
                }))
            }
        }
        if (a.downloadable) {
            i.dldCmd = cx.dom.create("div", "file-cmd iconDownload", i.cmdBar, null);
            i.dldCmd.onclick = function (e) {
                e.preventDefault();
                cx.file.saveAs(a.filename, a.title)
            }
        }
        if (a.viewable) {
            i.viewCmd = cx.dom.create("div", "file-cmd iconPreview", i.cmdBar, null);
            i.viewCmd.onclick = function (e) {
                e.preventDefault();
                cx.file.preview(a.filename)
            }
        }
        i.onmouseenter = function () {
            cx.domClass.toggle(i.cmdBar, "hide")
        };
        i.onmouseleave = function () {
            cx.domClass.toggle(i.cmdBar, "hide")
        };
        t.list.push(a)
    };
    var n = function () {
        var e = {oldfiles: [], newfiles: []};
        for (var t = 0; t < this.list.length; t++) {
            if (this.list[t].isNew) e.newfiles.push(this.list[t].filename); else e.oldfiles.push(this.list[t].filename)
        }
        return e
    };
    var r = function () {
        var e = "";
        var t = 0;
        for (var a = 0; a < this.list.length; a++) {
            if (this.list[a].isNew) {
                e += (t == 0 ? "" : ";") + "file;" + this.list[a].filename + ";" + this.list[a].title + ";" + this.list[a].filelen;
                t++
            }
        }
        return e
    };
    var i = function (e) {
        e.cmdAdd = cx.dom.create("div", "file-item", e.target, null);
        cx.dom.create("div", "file-add iconAdd", e.cmdAdd, null);
        e.cmdAdd.onclick = function (t) {
            t.preventDefault();
            var a = new Caller(function (t) {
                var a = {
                    title: t.name,
                    filename: t.filename,
                    filelen: t.filelen,
                    iconCls: null,
                    deletable: !0,
                    downloadable: !0,
                    viewable: e.data.viewable,
                    isNew: !0
                };
                e.add(a)
            });
            var n = {
                url: "UploadSvr",
                title: gObj.loc.get("upload"),
                preview: e.data.viewable,
                convert: e.data.convert,
                onLoad: a
            };
            RunPlugin("UploadFile", n)
        }
    };
    cx.inherits(e, cx.ctrl.IControl);
    var o = e.prototype;
    o.create = t;
    o.add = a;
    o.getFiles = n;
    o.getFilesNew = r;
    return e
}();
cx.ctrl.Fold = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {title: null, expanded: !1};
        cx.extend(this.data, e);
        t.wndIcon = null;
        t.wndTitle = null;
        t.wndCont = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-fold";
        var r;
        var i;
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n);
            r = cx.parser.getChildren(t.target)
        } else {
            var o = {};
            if (a.id) o.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, o)
        }
        t.target.wnd = t;
        var c = cx.dom.create("div", "fo-title", t.target, null);
        t.wndIcon = cx.dom.create("div", a.expanded ? "fo-expand" : "fo-collapse", c, null);
        t.wndTitle = cx.dom.create("div", "fo-text", c, {innerHTML: a.title});
        t.wndCont = cx.dom.create("div", "fo-cont" + (a.expanded ? "" : " hide"), t.target, null);
        if (e) {
            for (i = 0; i < r.length; i++) {
                t.wndCont.appendChild(r[i])
            }
        } else {
            if (a.content) {
                cx.dom.setInnerHTML(t.wndCont, a.content)
            }
        }
        var s = function (e) {
            e.preventDefault();
            if (a.expanded) {
                cx.domClass.remove(t.wndIcon, "fo-expand");
                cx.domClass.add(t.wndIcon, "fo-collapse")
            } else {
                cx.domClass.remove(t.wndIcon, "fo-collapse");
                cx.domClass.add(t.wndIcon, "fo-expand")
            }
            cx.domClass.toggle(t.wndCont, "hide");
            a.expanded = !a.expanded
        };
        t.wndIcon.onclick = s;
        t.wndTitle.onclick = s
    };
    var a = function () {
        return this.wndCont
    };
    var n = function (e) {
        this.wndTitle.innerHTML = e
    };
    var r = function (e) {
        cx.dom.setContent(this.wndCont, e)
    };
    cx.inherits(e, cx.ctrl.IControl);
    var i = e.prototype;
    i.create = t;
    i.domCont = a;
    i.setTitle = n;
    i.setContent = r;
    return e
}();
cx.ctrl.Group = function () {
    var e = function (e, a, n) {
        var r = this;
        r.atts = n || {};
        r.title = a;
        r.pdom = e;
        r.dom = {group: null, title: null, cont: null};
        t(r)
    };
    var t = function (e) {
        if (!e.pdom)return;
        e.dom.group = cx.dom.create("ul", "cx-group" + " c_b", e.pdom, null);
        e.dom.title = cx.dom.create("li", "cx-group-title", e.dom.group, {innerHTML: e.title});
        e.dom.cont = cx.dom.create("li", "cx-group-content" + " ta_c", e.dom.group, null)
    };
    var a = function (e, t) {
        if (!t) cx.dom.append(e, this.dom.cont); else cx.dom.insertBefore(e, t)
    };
    var n = function () {
        return this.dom.cont.childNodes
    };
    var r = function (e) {
        cx.dom.remove(e)
    };
    var i = e.prototype;
    i.addBefore = a;
    i.getDoms = n;
    i.remove = r;
    return e
}();
cx.ctrl.DialogMsg = function () {
    var e = function (e) {
        var t = "<div class='cx-msgbox full_1'>" + "<table class='cx-tablelayout'>" + "<tr class='h_10'></tr>" + "<tr><td class='msgbox-icon'></td><td class='msgbox-cont'>" + e.msg + "</td></tr>" + "<tr class='h_10'></tr>" + "</table>" + "</div>";
        this.options = {
            modal: !0,
            closable: !0,
            width: e.width || 450,
            height: e.height || 150,
            title: e.title,
            content: t
        };
        cx.extend(this.options, e)
    };
    var t = function () {
        var e = new cx.ctrl.DialogCmd(this.options);
        e.create();
        e.initCmd(["ta_c"]);
        e.addButtons([{label: gObj.loc.close, iconCls: "iconOk", className: "cmdBtn_c", close: !0, onClick: null}])
    };
    var a = e.prototype;
    a.init = t;
    return e
}();
cx.ctrl.DialogConfirm = function () {
    var e = function (e) {
        var t = "<div class='cx-msgbox full_1'>" + "<table class='cx-tablelayout'>" + "<tr class='h_10'></tr>" + "<tr><td class='msgbox-icon'></td><td class='msgbox-cont'>" + e.msg + "</td></tr>" + "<tr class='h_10'></tr>" + "</table>" + "</div>";
        this.options = {
            modal: !0,
            closable: !0,
            width: e.width || 450,
            height: e.height || 150,
            title: e.title,
            content: t,
            okCall: e.okCall,
            cancelCall: e.cancelCall
        };
        cx.extend(this.options, e)
    };
    var t = function () {
        var e = new cx.ctrl.DialogCmd(this.options);
        e.create();
        e.initCmd(["ta_c"]);
        e.addButtons([{
            label: gObj.loc.ok,
            iconCls: "iconOk",
            className: "cmdBtn_c",
            close: !0,
            onClick: this.options.okCall
        }, {
            label: gObj.loc.cancel,
            iconCls: "iconCancel",
            className: "cmdBtn_c",
            close: !0,
            onClick: this.options.cancelCall
        }])
    };
    var a = e.prototype;
    a.init = t;
    return e
}();
cx.ctrl.DialogDetail = function () {
    var e = function (e) {
        var t = cx.newId();
        var a = "<div class='cx-msgbox full_1'>" + "<table class='cx-tablelayout'>" + "<tr class='h_10'></tr>" + "<tr><td class='msgbox-icon'></td><td class='msgbox-cont'>" + e.msg + "</td></tr>" + "<tr><td colspan='2' id='" + t + "''>" + "<div class='ftr_node'>" + "<div class='ftr_title'>" + "<div class='ftr_collapse'></div>" + "<div class='ftr_text'></div>" + "</div>" + "<div class='ftr_cont'>" + "<div class='divDispInfo'>" + e.detail + "</div>" + "</div>" + "</div>" + "</td></tr>" + "<tr class='h_10'></tr>" + "</table>" + "</div>";
        this.options = {
            modal: !0,
            closable: !0,
            width: e.width || 450,
            height: e.height || 150,
            title: e.title,
            content: a,
            id: t
        }
    };
    var t = function () {
        var e = new cx.ctrl.DialogCmd(this.options);
        e.create();
        e.initCmd(["ta_c"]);
        e.addButtons([{label: gObj.loc.close, iconCls: "iconOk", className: "cmdBtn_c", close: !0, onClick: null}]);
        var t = this;
        cx.ctrl.FoldMan(this.options.id, function (a) {
            if (a) e.setSize(t.options.width, t.options.height + 30); else e.setSize(t.options.width, t.options.height)
        })
    };
    var a = e.prototype;
    a.init = t;
    return e
}();
cx.ctrl.DialogMultiMsg = function () {
    var e = function (e) {
        e = e || {};
        e.modal = !0;
        e.closable = !0;
        e.width = e.width || 550;
        e.height = e.height || 300;
        e.content = "";
        e.onClose = new Caller(this, "close");
        cx.base(this, e)
    };
    var t = function () {
        this.create();
        this.initCmd(["ta_c"]);
        this.addButtons([{
            label: gObj.loc.close,
            iconCls: "iconOk",
            className: "cmdBtn_c",
            close: !0,
            onClick: new Caller(this, "close")
        }]);
        var e, t, a;
        e = cx.dom.create("div", "cx-msgbox full_1", this.domCont(), null);
        t = cx.dom.create("table", "cx-tablelayout", e, null);
        a = cx.dom.create("tr", "ta_c", t, null);
        cx.dom.create("td", "msgbox-icon", a, null);
        cx.dom.create("td", "msgbox-cont", a, {innerHTML: gObj.loc.msgErrInfo});
        a = cx.dom.create("tr", null, t, null);
        cx.dom.create("td", null, a, null);
        this.msgList = cx.dom.create("td", "c_gray ta_l", a, null)
    };
    var a = function (e, t) {
        var a = {container: this.msgList, title: e, content: t};
        new cx.ctrl.Fold(a).create()
    };
    var n = function () {
        if (gObj.dlgMultiMsg) {
            gObj.dlgMultiMsg.destroy();
            gObj.dlgMultiMsg = null
        }
    };
    cx.inherits(e, cx.ctrl.DialogCmd);
    var r = e.prototype;
    r.init = t;
    r.add = a;
    r.close = n;
    return e
}();
cx.ctrl.ItemList = function () {
    var e = function (e) {
        cx.base(this, e);
        this.list = []
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-itemlist";
        var r, i;
        var o;
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n + "-" + a.iconSize);
            r = cx.parser.getChildren(t.target)
        } else {
            var c = {};
            if (a.id) c.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n + "-" + a.iconSize, a.container, c)
        }
        t.target.wnd = t;
        t.select = 0;
        if (a.select) {
            switch (a.select) {
                case"none":
                    t.select = 0;
                    break;
                case"single":
                    t.select = 1;
                    break;
                case"multiple":
                    t.select = 2;
                    break
            }
        }
        if (e) {
            for (o = 0; o < r.length; o++) {
                i = {};
                if (r[o].id) i.id = r[o].id;
                cx.extend(i, cx.parser.getOptions($(r[o]).attr("data-options")));
                t.add(i)
            }
            for (o = 0; o < r.length; o++) {
                cx.dom.remove(r[o])
            }
        }
    };
    var a = function () {
        this.list = null;
        cx.base(this, "destroy")
    };
    var n = function () {
        return cx.dom.getChildren(this.target)
    };
    var r = function (e) {
        var t = this;
        var a = cx.dom.create("div", "itemlist-item", t.target, null);
        var n = cx.dom.create("div", "item-icon " + e.iconCls, a, null);
        var r = cx.dom.create("div", "item-selected iconSelected hide", n, null);
        var i = cx.dom.create("div", "item-title", a, null);
        var o = cx.dom.create("div", "item-text", i, {innerHTML: e.title});
        a.selTag = r;
        a.itemVal = e;
        t.list.push(a);
        if (t.select != 0) {
            if (a.itemVal.selected) {
                t.selectItem(a, !1)
            }
        }
        a.onclick = function (e) {
            e.preventDefault();
            switch (t.select) {
                case 0:
                    if (a.itemVal.onClick) {
                        a.itemVal.onClick.call()
                    }
                    break;
                case 1:
                    if (!a.itemVal.selected) {
                        t.selectItem(a, !0)
                    }
                    break;
                case 2:
                    if (a.itemVal.selected) {
                        t.unselectItem(a, !0)
                    } else {
                        t.selectItem(a, !0)
                    }
                    break
            }
        };
        return a
    };
    var i = function (e, t) {
        var a = this;
        var n;
        if (a.select == 1) {
            for (var r = 0; r < a.list.length; r++) {
                n = a.list[r];
                if (n != e && n.itemVal.selected) {
                    a.unselectItem(n, t)
                }
            }
        }
        cx.domClass.remove(e.selTag, "hide");
        e.itemVal.selected = !0;
        if (t && e.itemVal.onSelect) {
            e.itemVal.onSelect.call(e.itemVal)
        }
    };
    var o = function (e, t) {
        if (!e.itemVal.selected)return;
        cx.domClass.add(e.selTag, "hide");
        e.itemVal.selected = !1;
        if (t && e.itemVal.onUnselect) {
            e.itemVal.onUnselect.call()
        }
    };
    cx.inherits(e, cx.ctrl.IControl);
    var c = e.prototype;
    c.create = t;
    c.destroy = a;
    c.getItems = n;
    c.add = r;
    c.selectItem = i;
    c.unselectItem = o;
    return e
}();
cx.ctrl.PageFlat = function () {
    var e = function (e) {
        var t = this;
        t.data = {content: ""};
        cx.extend(t.data, e);
        t.wndNav = null;
        t.wndTitle = null;
        t.wndCongBg = null;
        t.wndCont = null;
        t.parent = null;
        t.selected = !1
    };
    var t = function (e, t) {
        var a = this;
        var n = a.data;
        var r;
        a.parent = t;
        if (e) {
            cx.extend(n, cx.parser.getOptions($(e).attr("data-options")));
            r = cx.parser.getChildren(e);
            if (n.iconCls) n.icon = n.iconCls
        }
        var i = {};
        if (n.id && n.id != "") i.id = n.id;
        a.wndNav = cx.dom.create("div", "tabf-nav tabf-inactive", t.domNav(), i);
        a.wndNav.wnd = a;
        a.wndTitle = cx.dom.create("div", "tabf-text", a.wndNav, {innerHTML: n.title});
        a.wndCongBg = cx.dom.create("div", "tabf-cont-bg full_0 of_a", t.domCont(), null);
        a.wndCont = cx.dom.create("div", "tabf-cont full_1 of_a", a.wndCongBg, null);
        if (e) {
            for (var o = 0; o < r.length; o++) {
                a.wndCont.appendChild(r[o])
            }
            t.addChild(a, n.selected);
            cx.dom.remove(e)
        } else {
            if (n.content && n.content != "") {
                a.setContent(n.content)
            }
            if (n.url && n.url != "") {
                a.setHref(n.url)
            }
        }
        a.wndNav.onclick = function (e) {
            e.preventDefault();
            a.parent.selectChild(a)
        }
    };
    var a = function () {
        cx.dom.clearEasyUi(this.wndCont);
        this.wndNav.wnd = null;
        cx.dom.remove(this.wndCongBg);
        cx.dom.remove(this.wndNav)
    };
    var n = function () {
        this.parent.deleteChild(this)
    };
    var r = function () {
        return this.parent
    };
    var i = function () {
        return this.wndNav
    };
    var o = function () {
        return this.wndCont
    };
    var c = function () {
        return this.selected
    };
    var s = function (e) {
        cx.dom.setInnerHTML(this.wndTitle, e)
    };
    var l = function (e) {
        var t = this.data;
        if (e && e != "") {
            cx.ajax.loadHtml({url: e, dom: this.wndCont, onLoad: t.onLoad, onReplaceId: t.onReplaceId})
        }
    };
    var d = function (e) {
        cx.dom.setContent(this.wndCont, e)
    };
    var u = function () {
        var e = this;
        if (e.selected)return;
        e.selected = !0;
        cx.domClass.remove(e.wndNav, "tabf-inactive");
        cx.domClass.add(e.wndNav, "tabf-active");
        cx.dom.setVisible(e.wndCongBg, !0);
        cx.layout.resize(e.wndCont);
        e.onSelect()
    };
    var f = function () {
        var e = this;
        if (!e.selected)return;
        e.selected = !1;
        cx.domClass.remove(e.wndNav, "tabf-active");
        cx.domClass.add(e.wndNav, "tabf-inactive");
        cx.dom.setVisible(e.wndCongBg, !1);
        e.onUnselect()
    };
    var v = function () {
    };
    var g = function () {
    };
    var h = e.prototype;
    h.create = t;
    h.destroy = a;
    h.destroySelf = n;
    h.getParent = r;
    h.domNav = i;
    h.domCont = o;
    h.isSelected = c;
    h.setTitle = s;
    h.setHref = l;
    h.setContent = d;
    h.select = u;
    h.unselect = f;
    h.onSelect = v;
    h.onUnselect = g;
    return e
}();
cx.ctrl.PageTab = function () {
    var e = function (e) {
        var t = this;
        t.data = {content: "", closable: !0};
        cx.extend(t.data, e);
        t.wndNav = null;
        t.wndIcon = null;
        t.wndTitle = null;
        t.wndClose = null;
        t.wndCongBg = null;
        t.wndCont = null;
        t.parent = null;
        t.selected = !1;
        t.deleted = !1
    };
    var t = function (e, t) {
        var a = this;
        var n = a.data;
        var r;
        var i = "";
        var o;
        a.parent = t;
        if (e) {
            cx.extend(n, cx.parser.getOptions($(e).attr("data-options")));
            r = cx.parser.getChildren(e);
            if (n.iconCls) n.icon = n.iconCls
        }
        switch (t.data.tabPosition) {
            case 1:
                i = "tab-nav-mpb-top tab-inactive-top";
                break;
            case 2:
                i = "tab-nav-mpb-bottom tab-inactive-bottom";
                break
        }
        var c = {};
        if (n.id && n.id != "") c.id = n.id;
        a.wndNav = cx.dom.create("div", "tab-nav " + i, t.domNav(), c);
        a.wndNav.wnd = a;
        if (n.icon && n.icon != "") a.wndIcon = cx.dom.create("div", "tab-icon " + n.icon, a.wndNav, null);
        a.wndTitle = cx.dom.create("div", "tab-text", a.wndNav, {innerHTML: n.title});
        if (n.closable) a.wndClose = cx.dom.create("div", "tab-close", a.wndNav, null);
        a.wndCongBg = cx.dom.create("div", "tab-cont-bg full_0 of_a", t.domCont(), null);
        a.wndCont = cx.dom.create("div", "tab-cont full_1 of_a", a.wndCongBg, null);
        switch (a.parent.data.tabPosition) {
            case 1:
                i = "cx-corner-top-small";
                break;
            case 2:
                i = "cx-corner-bottom-small";
                break
        }
        cx.domClass.add(a.wndNav, i);
        if (e) {
            for (o = 0; o < r.length; o++) {
                a.wndCont.appendChild(r[o])
            }
            t.addChild(a, n.selected);
            cx.dom.remove(e)
        } else {
            if (n.content && n.content != "") {
                a.setContent(n.content)
            }
            if (n.url && n.url != "") {
                a.setHref(n.url)
            }
        }
        a.wndNav.onclick = function () {
            if (!a.deleted) {
                a.parent.selectChild(a)
            }
        };
        if (a.wndClose) {
            a.wndClose.onclick = function () {
                a.parent.deleteChild(a, !0)
            }
        }
    };
    var a = function () {
        cx.dom.clearEasyUi(this.wndCont);
        this.deleted = !0;
        cx.dom.remove(this.wndCongBg);
        cx.dom.remove(this.wndNav)
    };
    var n = function () {
        this.parent.deleteChild(this)
    };
    var r = function (e) {
        if (this.data.onClose) {
            this.data.onClose.call(e)
        }
        this.destroy()
    };
    var i = function () {
        return this.parent
    };
    var o = function () {
        return this.wndNav
    };
    var c = function () {
        return this.wndCont
    };
    var s = function () {
        return this.selected
    };
    var l = function (e) {
        cx.dom.setInnerHTML(this.wndTitle, e)
    };
    var d = function (e) {
        var t = this.data;
        if (e && e != "") {
            cx.ajax.loadHtml({url: e, dom: this.wndCont, onLoad: t.onLoad, onReplaceId: t.onReplaceId})
        }
    };
    var u = function (e) {
        cx.dom.setContent(this.wndCont, e)
    };
    var f = function () {
        var e = this;
        if (e.selected)return;
        e.selected = !0;
        switch (e.parent.data.tabPosition) {
            case 1:
                cx.domClass.remove(e.wndNav, "tab-inactive-top");
                cx.domClass.add(e.wndNav, "tab-active-top");
                break;
            case 2:
                cx.domClass.remove(e.wndNav, "tab-inactive-bottom");
                cx.domClass.add(e.wndNav, "tab-active-bottom");
                break
        }
        cx.dom.setVisible(e.wndCongBg, !0);
        cx.layout.resize(e.wndCont)
    };
    var v = function () {
        var e = this;
        if (!e.selected)return;
        e.selected = !1;
        switch (e.parent.data.tabPosition) {
            case 1:
                cx.domClass.remove(e.wndNav, "tab-active-top");
                cx.domClass.add(e.wndNav, "tab-inactive-top");
                break;
            case 2:
                cx.domClass.remove(e.wndNav, "tab-active-bottom");
                cx.domClass.add(e.wndNav, "tab-inactive-bottom");
                break
        }
        cx.dom.setVisible(e.wndCongBg, !1)
    };
    var g = e.prototype;
    g.create = t;
    g.destroy = a;
    g.destroySelf = n;
    g.close = r;
    g.getParent = i;
    g.domNav = o;
    g.domCont = c;
    g.isSelected = s;
    g.setTitle = l;
    g.setHref = d;
    g.setContent = u;
    g.select = f;
    g.unselect = v;
    return e
}();
namespace("cx.ctrl.ProgressBar");
cx.ctrl.ProgressBar = function (e) {
    e = e || {};
    this.opts = {
        width: e.width || 300,
        height: e.height || 70,
        title: e.title || "",
        closable: e.closable !== void 0 ? e.closable : !1
    };
    this.ids = {dlg: "progressbarDlg"};
    this.running = !1;
    this.imgPath = cx.theme + "/img/progressbar.gif";
    this.dlg = null
};
cx.ctrl.ProgressBar.prototype.constructor = cx.ctrl.ProgressBar;
cx.ctrl.ProgressBar.prototype.destroy = function () {
    if (this.dlg) {
        this.dlg.destroy();
        this.dlg = null
    }
    this.running = !1
};
cx.ctrl.ProgressBar.prototype.create = function () {
    if (this.running)return;
    this.running = !0;
    var e = this;
    e.dlg = new cx.ctrl.Dialog({
        id: e.ids.dlg, title: e.opts.title, closable: e.opts.closable, onClose: function () {
            e.destroy()
        }, modal: !0, width: e.opts.width, height: e.opts.height
    });
    e.dlg.create();
    cx.dom.create("img", null, e.dlg.domCont(), {
        src: this.imgPath,
        style: "width:" + (e.opts.width - 50) + "px;height:15px;margin:9px 20px"
    })
};
namespace("cx.ctrl.ProgressBarN");
cx.ctrl.ProgressBarN = function (e) {
    e = e || {};
    this.opts = {
        width: e.width || 300,
        height: e.height || 70,
        title: e.title || "",
        closable: e.closable !== void 0 ? e.closable : !1,
        timecall: cx.isFunc(e.timecall) ? e.timecall : function () {
        }
    };
    this.ids = {dlg: "progressbarNDlg"};
    this.running = !1;
    this.dlg = null
};
cx.ctrl.ProgressBarN.prototype.constructor = cx.ctrl.ProgressBarN;
cx.ctrl.ProgressBarN.prototype.destroy = function () {
    if (this.dlg) {
        this.dlg.destroy();
        this.dlg = null
    }
    this.running = !1;
    if (this.in) {
        clearInterval(this.in);
        this.in = null
    }
};
cx.ctrl.ProgressBarN.prototype.create = function () {
    if (this.running)return;
    this.running = !0;
    var e = this;
    e.dlg = new cx.ctrl.Dialog({
        id: e.ids.dlg, title: e.opts.title, closable: e.opts.closable, onClose: function () {
            e.destroy()
        }, modal: !0, width: e.opts.width, height: e.opts.height
    });
    e.dlg.create();
    cx.dom.create("div", null, e.dlg.domCont(), {
        id: "p",
        style: "width:" + (e.opts.width - 50) + "px;height:15px;margin:9px 20px"
    });
    $("#p").progressbar({value: 0});
    this.in = setInterval(e.opts.timecall, 2e3)
};
cx.ctrl.ProgressBarN.prototype.setVal = function (e) {
    $("#p").progressbar("setValue", e)
};
cx.ctrl.ProgressBarN.prototype.setTitle = function (e) {
    this.dlg.setTitle(e)
};
cx.ctrl.RegionBar = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {expanded: !0};
        cx.extend(t.data, e);
        t.handlerS = 14;
        t.handlerL = 32;
        t.handler = null;
        t.wndIcon = null;
        t.region = null;
        t.wndRegion = null;
        t.wndLayout = null;
        t.created = !1;
        t.minimized = !1
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n;
        var i = function () {
            cx.dom.append(t.target, t.wndLayout);
            n = "";
            switch (a.position) {
                case 3:
                    n = "rb-hand-v cx-border-no-left cx-shadow-rb cx-corner-right-mini";
                    break;
                case 4:
                    n = "rb-hand-v cx-border-no-right cx-shadow-lb cx-corner-left-mini";
                    break
            }
            t.handler = cx.dom.create("div", n + " pos_abs", t.target, null);
            switch (a.position) {
                case 3:
                    t.wndIcon = cx.dom.create("div", "rb-icon rb-icon-left-open", t.handler, null);
                    cx.dom.setStyle(t.wndIcon, {left: 4 + "px", top: t.handlerL + "px"});
                    break;
                case 4:
                    t.wndIcon = cx.dom.create("div", "rb-icon rb-icon-right-open", t.handler, null);
                    cx.dom.setStyle(t.wndIcon, {right: 4 + "px", top: t.handlerL + "px"});
                    break
            }
            o();
            t.handler.onclick = function () {
                r(t)
            };
            if (!a.expanded) {
                r(t)
            }
        };
        var o = function () {
            var e = cx.dom.getPosSizeBody(t.wndRegion);
            switch (a.position) {
                case 3:
                    cx.dom.setStyle(t.handler, {
                        left: (t.minimized ? 0 : e.x + e.w) + "px",
                        top: e.y + e.h / 2 - t.handlerL + "px"
                    });
                    break;
                case 4:
                    cx.dom.setStyle(t.handler, {
                        right: (t.minimized ? 0 : e.x + e.w) + "px",
                        top: e.y + e.h / 2 - t.handlerL + "px"
                    });
                    break
            }
        };
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            t.wndRegion = t.target.parentNode;
            var c = cx.parser.getOptions($(t.wndRegion).attr("data-options"));
            t.region = c.region;
            t.wndLayout = t.wndRegion.parentNode;
            var s = t.wndRegion.onResize;
            t.wndRegion.onResize = function () {
                if (s) s();
                if (t.created) {
                    o()
                } else {
                    i();
                    t.created = !0
                }
            }
        }
        t.target.wnd = t;
        switch (t.region) {
            case"west":
                a.position = 3;
                break;
            case"east":
                a.position = 4;
                break
        }
    };
    var a = function () {
        if (this.minimized) r(this)
    };
    var n = function () {
        if (!this.minimized) r(this)
    };
    var r = function (e) {
        var t = "";
        var a = "";
        if (e.minimized) {
            e.minimized = !1;
            e.wndLayout.wnd.expand(e.region);
            var n = cx.dom.getSize(e.wndRegion);
            switch (e.data.position) {
                case 3:
                    cx.dom.setStyle(e.handler, {left: n.w + "px"});
                    t = "rb-icon-left-close";
                    a = "rb-icon-left-open";
                    break;
                case 4:
                    cx.dom.setStyle(e.handler, {right: n.w + "px"});
                    t = "rb-icon-right-close";
                    a = "rb-icon-right-open";
                    break
            }
            cx.domClass.remove(e.wndIcon, t);
            cx.domClass.add(e.wndIcon, a);
            if (e.onExpand) e.onExpand()
        } else {
            e.minimized = !0;
            e.wndLayout.wnd.collapse(e.region);
            switch (e.data.position) {
                case 3:
                    cx.dom.setStyle(e.handler, {left: 0 + "px"});
                    t = "rb-icon-left-open";
                    a = "rb-icon-left-close";
                    break;
                case 4:
                    cx.dom.setStyle(e.handler, {right: 0 + "px"});
                    t = "rb-icon-right-open";
                    a = "rb-icon-right-close";
                    break
            }
            cx.domClass.remove(e.wndIcon, t);
            cx.domClass.add(e.wndIcon, a);
            if (e.onCollapse) e.onCollapse()
        }
    };
    cx.inherits(e, cx.ctrl.IControl);
    var i = e.prototype;
    i.create = t;
    i.expand = a;
    i.collapse = n;
    return e
}();
cx.ctrl.SelDepPos = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {};
        cx.extend(t.data, e)
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-seldeppos";
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n);
            var r = gObj.init.user.organs;
            if (cx.isArr(r)) {
                var i = [];
                var o = "";
                for (var c = 0; c < r.length; c++) {
                    switch (a.select) {
                        case"position":
                            i.push({value: r[c].position, label: r[c].position});
                            if (c == 0) o = r[c].position;
                            break;
                        case"department":
                        default:
                            i.push({value: r[c].code, label: gLoc ? r[c].namec : r[c].nemee});
                            if (c == 0) o = r[c].code;
                            break
                    }
                }
                cx.select.setOpts($(t.target).combobox(), i, "value", "label", o)
            }
        }
    };
    cx.inherits(e, cx.ctrl.IControl);
    var a = e.prototype;
    a.create = t;
    return e
}();
cx.ctrl.Shadow = function () {
    var e = function (e) {
        var t = this;
        t.data = {visible: !0, style: null};
        cx.extend(t.data, e);
        t.wndBg = null;
        t.wndIFrm = null
    };
    var t = function () {
        var e = this;
        e.wndBg = cx.dom.create("div", "cx-win-shadow" + (!e.data.visible ? " hide" : ""), cx.dom.body(), {style: e.data.style});
        e.wndIFrm = cx.dom.create("iframe", "cx-win-iframe", e.wndBg, null)
    };
    var a = function () {
        var e = this;
        if (e.wndBg) {
            cx.dom.body().removeChild(e.wndBg)
        }
        e.wndIFrm = null;
        e.wndBg = null
    };
    var n = function () {
        cx.dom.setVisible(this.wndBg, !0)
    };
    var r = function () {
        cx.dom.setVisible(this.wndBg, !1)
    };
    var i = function (e) {
        cx.dom.setStyle(this.wndBg, e)
    };
    var o = e.prototype;
    o.create = t;
    o.destroy = a;
    o.show = n;
    o.hide = r;
    o.setStyle = i;
    return e
}();
cx.ctrl.SideBar = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {expanded: !0};
        cx.extend(t.data, e);
        t.handlerS = 14;
        t.handlerL = 32;
        t.wndContBg = null;
        t.wndCont = null;
        t.handler = null;
        t.wndIcon = null;
        t.minimized = !1
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-sidebar";
        var r;
        var o;
        var c;
        var s = function () {
            var e = {
                left: t.wndContBg.clientLeft,
                top: t.wndContBg.clientTop,
                width: t.wndContBg.offsetWidth,
                height: t.wndContBg.clientHeight
            };
            switch (a.position) {
                case 1:
                    cx.dom.setStyle(t.handler, {
                        top: e.top + e.height - 1 + "px",
                        left: e.left + e.width / 2 - t.handlerL + "px"
                    });
                    break;
                case 3:
                    cx.dom.setStyle(t.handler, {
                        left: e.left + e.width - 2 + "px",
                        top: e.top + e.height / 2 - t.handlerL + "px"
                    });
                    break;
                case 4:
                    cx.dom.setStyle(t.handler, {
                        right: e.left + e.width - 3 + "px",
                        top: e.top + e.height / 2 - t.handlerL + "px"
                    });
                    break;
                case 2:
                    cx.dom.setStyle(t.handler, {
                        bottom: e.top + e.height - 1 + "px",
                        left: e.left + e.width / 2 - t.handlerL + "px"
                    });
                    break
            }
        };
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n);
            o = cx.parser.getChildren(t.target)
        } else {
            var l = {};
            if (a.id) l.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, {id: a.id});
            cx.dom.setStyle(t.target, a.style)
        }
        t.target.wnd = t;
        a.position = cx.consts.getPosition(a.position);
        n = "sb-cont-bg ";
        r = "";
        switch (a.position) {
            case 1:
                n += "cx-border-no-top cx-shadow-rb";
                r = "left:0;top:0;right:0;bottom:";
                break;
            case 3:
                n += "cx-border-no-left cx-shadow-rb";
                r = "left:0;top:0;bottom:0;right:";
                break;
            case 4:
                n += "cx-border-no-right cx-shadow-lb";
                r = "top:0;right:0;bottom:0;left:";
                break;
            case 2:
                n += "cx-border-no-bottom cx-shadow-rt";
                r = "left:0;right:0;bottom:0;top:";
                break
        }
        t.wndContBg = cx.dom.create("div", n, t.target, {style: r + t.handlerS + "px"});
        t.wndCont = cx.dom.create("div", "sb-cont", t.wndContBg, null);
        n = "";
        switch (a.position) {
            case 1:
                n = "sb-hand-h cx-border-no-top cx-shadow-rb cx-corner-bottom-mini";
                break;
            case 3:
                n = "sb-hand-v cx-border-no-left cx-shadow-rb cx-corner-right-mini";
                break;
            case 4:
                n = "sb-hand-v cx-border-no-right cx-shadow-lb cx-corner-left-mini";
                break;
            case 2:
                n = "sb-hand-h cx-border-no-bottom cx-shadow-rt cx-corner-top-mini";
                break
        }
        t.handler = cx.dom.create("div", n, t.target, null);
        switch (a.position) {
            case 1:
                t.wndIcon = cx.dom.create("div", "sb-icon sb-icon-top-open", t.handler, null);
                cx.dom.setStyle(t.wndIcon, {top: 4 + "px", left: t.handlerL + "px"});
                break;
            case 3:
                t.wndIcon = cx.dom.create("div", "sb-icon sb-icon-left-open", t.handler, null);
                cx.dom.setStyle(t.wndIcon, {left: 4 + "px", top: t.handlerL + "px"});
                break;
            case 4:
                t.wndIcon = cx.dom.create("div", "sb-icon sb-icon-right-open", t.handler, null);
                cx.dom.setStyle(t.wndIcon, {right: 4 + "px", top: t.handlerL + "px"});
                break;
            case 2:
                t.wndIcon = cx.dom.create("div", "sb-icon sb-icon-bottom-open", t.handler, null);
                cx.dom.setStyle(t.wndIcon, {top: 4 + "px", left: t.handlerL + "px"});
                break
        }
        if (e) {
            for (c = 0; c < o.length; c++) {
                t.wndCont.appendChild(o[c])
            }
        } else {
            if (a.content && a.content != "") cx.dom.setInnerHTML(t.wndCont, a.content)
        }
        s();
        t.wndContBg.onResize = function () {
            s()
        };
        t.handler.onclick = function () {
            i(t, !0)
        };
        if (!a.expanded) {
            i(t, !1)
        }
    };
    var a = function () {
        return this.wndCont
    };
    var n = function () {
        if (this.minimized) i(this, !0)
    };
    var r = function () {
        if (!this.minimized) i(this, !0)
    };
    var i = function (e, t) {
        var a = "";
        var n = "";
        if (e.minimized) {
            e.minimized = !1;
            switch (e.data.position) {
                case 1:
                    $(e.target).animate({top: 0}, t ? 300 : 0);
                    a = "sb-icon-top-close";
                    n = "sb-icon-top-open";
                    break;
                case 3:
                    $(e.target).animate({left: 0}, t ? 300 : 0);
                    a = "sb-icon-left-close";
                    n = "sb-icon-left-open";
                    break;
                case 4:
                    $(e.target).animate({right: 0}, t ? 300 : 0);
                    a = "sb-icon-right-close";
                    n = "sb-icon-right-open";
                    break;
                case 2:
                    $(e.target).animate({bottom: 0}, t ? 300 : 0);
                    a = "sb-icon-bottom-close";
                    n = "sb-icon-bottom-open";
                    break
            }
            cx.domClass.remove(e.wndIcon, a);
            cx.domClass.add(e.wndIcon, n);
            if (t && e.onExpand) e.onExpand()
        } else {
            e.minimized = !0;
            var r = cx.dom.getSize(e.target);
            switch (e.data.position) {
                case 1:
                    $(e.target).animate({top: -(r.h - e.handlerS) + "px"}, t ? 300 : 0);
                    a = "sb-icon-top-open";
                    n = "sb-icon-top-close";
                    break;
                case 3:
                    $(e.target).animate({left: -(r.w - e.handlerS) + "px"}, t ? 300 : 0);
                    a = "sb-icon-left-open";
                    n = "sb-icon-left-close";
                    break;
                case 4:
                    $(e.target).animate({right: -(r.w - e.handlerS) + "px"}, t ? 300 : 0);
                    a = "sb-icon-right-open";
                    n = "sb-icon-right-close";
                    break;
                case 2:
                    $(e.target).animate({bottom: -(r.h - e.handlerS) + "px"}, t ? 300 : 0);
                    a = "sb-icon-bottom-open";
                    n = "sb-icon-bottom-close";
                    break
            }
            cx.domClass.remove(e.wndIcon, a);
            cx.domClass.add(e.wndIcon, n);
            if (t && e.onCollapse) e.onCollapse()
        }
    };
    cx.inherits(e, cx.ctrl.IControl);
    var o = e.prototype;
    o.create = t;
    o.domCont = a;
    o.expand = n;
    o.collapse = r;
    return e
}();
cx.ctrl.TabFlat = function () {
    var e = function (e) {
        var t = this;
        t.data = {};
        cx.extend(t.data, e);
        t.list = [];
        t.target = null;
        t.wndNavs = null;
        t.wndConts = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-tabflat";
        var r, i, o;
        var c;
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n);
            r = cx.parser.getChildren(t.target)
        } else {
            var s = {};
            if (a.id) s.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, s)
        }
        t.target.wnd = t;
        t.wndNavs = cx.dom.create("div", "tabf-navs", t.target, null);
        t.wndConts = cx.dom.create("div", "tabf-conts", t.target, null);
        if (e) {
            for (c = 0; c < r.length; c++) {
                o = {};
                if (r[c].id) o.id = r[c].id;
                i = new cx.ctrl.PageFlat(o);
                i.create(r[c], t)
            }
            for (c = r.length - 1; c >= 0; c--) {
                cx.dom.remove(r[c])
            }
        }
    };
    var a = function () {
        this.deleteChildren();
        cx.dom.remove(this.target);
        this.target = null
    };
    var n = function () {
        return this.wndNavs
    };
    var r = function () {
        return this.wndConts
    };
    var i = function (e) {
        var t = this.list;
        for (var a = 0; a < t.length; a++) {
            if (t[a].page.getId() == e)return t[a].page
        }
        return null
    };
    var o = function (e, t) {
        var a = this;
        var n;
        this.list.push(e);
        if (a.list.length == 1) {
            cx.domClass.add(e.domNav(), "cx-corner-west")
        }
        for (n = a.list.length - 2; n >= 0; n--) {
            cx.domClass.remove(a.list[n].domNav(), "cx-corner-east")
        }
        cx.domClass.add(e.domNav(), "cx-corner-east");
        if (t) a.selectChild(e)
    };
    var c = function () {
        for (var e = 0; e < this.list.length; e++)this.list[e].destroy();
        this.list = []
    };
    var s = function (e) {
        var t = this.list;
        for (var a = 0; a < t.length; a++) {
            if (t[a] != e) {
                t[a].unselect()
            }
        }
        e.select()
    };
    var l = function () {
        cx.dom.setVisible(this.target, !0)
    };
    var d = function () {
        cx.dom.setVisible(this.target, !1)
    };
    var u = e.prototype;
    u.create = t;
    u.destroy = a;
    u.domNav = n;
    u.domCont = r;
    u.getChild = i;
    u.addChild = o;
    u.deleteChildren = c;
    u.selectChild = s;
    u.show = l;
    u.hide = d;
    return e
}();
cx.ctrl.Tabs = function () {
    var e = function (e) {
        var t = this;
        t.data = {tabPosition: "top"};
        cx.extend(t.data, e);
        t.list = [];
        t.target = null;
        t.wndNavs = null;
        t.wndConts = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-tabs";
        var r, i, o;
        var c, s, l;
        var d;
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n);
            c = cx.parser.getChildren(t.target)
        } else {
            var u = {};
            if (a.id) u.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, u)
        }
        t.target.wnd = t;
        a.tabPosition = cx.consts.getPosition(a.tabPosition);
        switch (a.tabPosition) {
            case 1:
                r = "tabs-navs-top";
                i = "top:0;";
                o = "top:2.0625em;bottom:0";
                break;
            case 2:
                r = "tabs-navs-bottom";
                i = "bottom:0;";
                o = "top:0;bottom:2.0625em";
                break
        }
        t.wndNavs = cx.dom.create("div", "tabs-navs " + r, t.target, {style: i});
        t.wndConts = cx.dom.create("div", "tabs-conts", t.target, {style: o});
        if (e) {
            for (d = 0; d < c.length; d++) {
                l = {};
                if (c[d].id) l.id = c[d].id;
                s = new cx.ctrl.PageTab(l);
                s.create(c[d], t)
            }
            for (d = c.length - 1; d >= 0; d--) {
                cx.dom.remove(c[d])
            }
        }
    };
    var a = function () {
        this.deleteChildren();
        cx.dom.remove(this.target);
        this.target = null
    };
    var n = function () {
        return this.wndNavs
    };
    var r = function () {
        return this.wndConts
    };
    var i = function (e) {
        var t = this.list;
        for (var a = 0; a < t.length; a++) {
            if (t[a].page.getId() == e)return t[a].page
        }
        return null
    };
    var o = function (e, t) {
        var a = this;
        a.list.push(e);
        if (t) a.selectChild(e);
        gObj.observer.publish("onAddTabPage", {index: a.list.length - 1, page: e}, a)
    };
    var c = function (e, t) {
        var a = null;
        var n = this.list;
        for (var r = 0; r < n.length; r++) {
            if (n[r] == e) {
                if (r < n.length - 1) {
                    a = n[r + 1];
                    break
                } else if (r > 0) {
                    a = n[r - 1];
                    break
                }
            }
        }
        if (e.isSelected()) {
            e.unselect();
            if (a) {
                a.select()
            }
        }
        n.splice(r, 1);
        e.close(t)
    };
    var s = function () {
        for (var e = 0; e < this.list.length; e++) {
            this.list[e].close(!1)
        }
        this.list = []
    };
    var l = function (e) {
        var t = this.list;
        for (var a = 0; a < t.length; a++) {
            if (t[a]) {
                t[a].unselect()
            }
        }
        e.select()
    };
    var d = function () {
        cx.dom.setVisible(this.target, !0)
    };
    var u = function () {
        cx.dom.setVisible(this.target, !1)
    };
    var f = e.prototype;
    f.create = t;
    f.destroy = a;
    f.domNav = n;
    f.domCont = r;
    f.getChild = i;
    f.addChild = o;
    f.deleteChild = c;
    f.deleteChildren = s;
    f.selectChild = l;
    f.show = d;
    f.hide = u;
    return e
}();
cx.ctrl.Tree = function () {
    var e = function (e) {
        this.opts = e || {}
    };
    var t = function (e, t) {
        var a = this;
        var n = a.opts;
        var r = null, i = null, o = null, c = null, s = null, l = null;
        var d;
        var u = e;
        if (!u) u = cx.dom.getDomNode(n.id);
        r = cx.dom.create("div", "tr-node", u, null);
        i = cx.dom.create("div", "tr-title", r, null);
        if (!n.isExpand || n.lazyLoad) d = "tr-collapse"; else d = "tr-expand";
        o = cx.dom.create("div", d, i, null);
        if (!n.isSingle) {
            if (!e && n.topCheck || e && n.nodeCheck) {
                c = cx.dom.create("div", "tr-checkbox tr-uncheck", i, null);
                c.isLeaf = !1;
                c.state = 0;
                c.data = t
            }
        }
        s = cx.dom.create("span", "tr-text", i, {innerHTML: t[n.labelName]});
        if (!n.nodeCheck) {
            s.data = t
        }
        l = cx.dom.create("div", "tr-child", r, null);
        if (!n.isExpand || n.lazyLoad) {
            o.state = !1;
            l.style.display = "none"
        } else {
            o.state = !0;
            l.style.display = "block"
        }
        if (n.lazyLoad) o.hasLoaded = !1; else o.hasLoaded = !0;
        cx.dom.bind(o, {
            onclick: function () {
                a.onExpand(o, l, t)
            }
        });
        if (c) {
            cx.dom.bind(c, {
                onclick: function () {
                    a.onCheckNode(c, r)
                }
            })
        }
        if (s) {
            if (n.isSingle && !n.topCheck && !n.nodeCheck && n.nodeClk) {
                cx.dom.bind(s, {
                    onclick: function () {
                        if (s.className == "tr-text") {
                            a.clearSelected();
                            s.className = "tr-text tr-selected";
                            n.nodeClk.call(t)
                        }
                    }
                })
            }
        }
        return l
    };
    var a = function (e, t) {
        var a = this;
        var n = a.opts;
        var r = null, i = null, o = null;
        var c = e;
        if (!c) c = cx.dom.byId(n.id);
        r = cx.dom.create("div", "tr-leaf", c, null);
        if (n.leafCheck) {
            i = cx.dom.create("div", "tr-checkbox tr-uncheck", r, null);
            i.state = 0;
            i.isLeaf = !0;
            i.data = t
        }
        o = cx.dom.create("span", "tr-text", r, {innerHTML: t[n.labelName]});
        if (!n.leafCheck) {
            o.data = t
        }
        if (i) {
            cx.dom.bind(i, {
                onclick: function () {
                    a.onCheckLeaf(i, r);
                    if (n.checkClk) n.checkClk.call(a.getChecked())
                }
            })
        }
        if (o) {
            if (n.isSingle) {
                cx.dom.bind(o, {
                    onclick: function () {
                        if (o.className == "tr-text") {
                            a.clearSelected();
                            o.className = "tr-text tr-selected";
                            if (n.leafClk) n.leafClk.call(t)
                        }
                    }
                })
            }
        }
        return r
    };
    var n = function (e, t) {
        var a;
        var n;
        for (n in t) {
            a = t[n];
            if (a[this.opts.childName] === void 0) {
                this._createLeaf(e, a)
            } else {
                var r = this._createNode(e, a);
                this.createNodeLeaf(r, a[this.opts.childName])
            }
        }
    };
    var r = function () {
        cx.dom.empty(this.opts.id)
    };
    var i = function (e) {
        this.clear();
        this.createNodeLeaf(null, e)
    };
    var o = function (e, t) {
        e.state = t;
        switch (t) {
            case-1:
                e.className = "tr-checkbox tr-incomplete";
                break;
            case 0:
                e.className = "tr-checkbox tr-uncheck";
                break;
            case 1:
                e.className = "tr-checkbox tr-checked";
                break
        }
    };
    var c = function (e, t) {
        var a = $(e).find(".tr-checkbox");
        var n;
        for (n = 0; n < a.length; n++) {
            this.setCheckState(a[n], t)
        }
    };
    var s = function (e) {
        var t = e.childNodes;
        var a = t[1];
        var n = a.childNodes;
        var r, i, o, c;
        var s = [];
        var l, d, u = !1;
        s[0] = s[1] = s[2] = 0;
        if (n.length > 0) u = !0;
        for (l = 0; l < n.length; l++) {
            r = n[l];
            if (r.className == "tr-leaf") {
                i = r.childNodes;
                for (d = 0; d < i.length; d++) {
                    o = i[d];
                    if (o.className.indexOf("tr-checkbox") >= 0) {
                        switch (o.state) {
                            case-1:
                                s[0]++;
                                break;
                            case 0:
                                s[1]++;
                                break;
                            case 1:
                                s[2]++;
                                break
                        }
                    }
                }
            } else if (r.className == "tr-node") {
                i = r.childNodes[0];
                o = i.childNodes;
                for (d = 0; d < o.length; d++) {
                    c = o[d];
                    if (c.className.indexOf("tr-checkbox") >= 0) {
                        switch (c.state) {
                            case-1:
                                s[0]++;
                                break;
                            case 0:
                                s[1]++;
                                break;
                            case 1:
                                s[2]++;
                                break
                        }
                    }
                }
            }
        }
        var f = 0;
        if (s[0] + s[1] + s[2] == 0) f = 0; else if (s[0] != 0 && s[1] == 0 && s[2] == 0) f = -1; else if (s[0] == 0 && s[1] != 0 && s[2] == 0) f = 0; else if (s[0] == 0 && s[1] == 0 && s[2] != 0) f = 1; else f = -1;
        if (u) {
            n = e.childNodes[0].childNodes;
            for (l = 0; l < n.length; l++) {
                r = n[l];
                if (r.className.indexOf("tr-checkbox") >= 0) {
                    this.setCheckState(r, f)
                }
            }
        }
        var v = e.parentNode;
        if (v.className != "tr-child")return;
        v = v.parentNode;
        if (v.className != "tr-node")return;
        this.checkParent(v)
    };
    var l = function (e, t) {
        var a = $(cx.dijit.getId(this.opts.id)).find(".tr-leaf");
        var n, r;
        var i, o;
        for (i = 0; i < a.length; i++) {
            n = $(a[i]).find(".tr-checkbox");
            for (o = 0; o < n.length; o++) {
                r = n[o];
                if (r.isLeaf != !0)continue;
                if (r.data[e] == t) {
                    this.onCheckLeaf(r, a[i]);
                    break
                }
            }
        }
    };
    var d = function (e) {
        var t = $(cx.dijit.getId(this.opts.id)).find(".tr-text");
        var a, n;
        var r;
        for (r = 0; r < t.length; r++) {
            a = t[r];
            n = cx.array.get1([a.data], e);
            if (!n)continue;
            this.clearSelected();
            $(a).click()
        }
    };
    var u = function (e) {
        var t = $(cx.dijit.getId(this.opts.id)).find(".tr-text");
        var a, n;
        var r;
        for (r = 0; r < t.length; r++) {
            a = t[r];
            n = cx.array.get1([a.data], e);
            if (n) {
                var i = $(a.parentNode.parentNode).children(".tr-child");
                if (i.length > 0)return i[0];
                return null
            }
        }
    };
    var f = function (e, t, a) {
        if (e.state == !0) {
            e.state = !1;
            e.className = "tr-collapse";
            t.style.display = "none"
        } else {
            if (e.hasLoaded != !0) {
                var n = this.opts.loadCaller;
                if (n) n.call(e, a);
                e.hasLoaded = !0
            }
            e.state = !0;
            e.className = "tr-expand";
            t.style.display = "block"
        }
    };
    var v = function (e, t) {
        if (e.state == 0) {
            this.checkChild(t, 1)
        } else {
            this.checkChild(t, 0)
        }
        this.checkParent(t);
        gObj.observer.publish("SelectIndex", null)
    };
    var g = function (e, t) {
        if (e.state == 0) {
            if (this.opts.isSingle == !0) {
                this.clearChecked()
            }
            this.setCheckState(e, 1)
        } else {
            this.setCheckState(e, 0)
        }
        var a = t.parentNode;
        if (a.className != "tr-child")return;
        a = a.parentNode;
        if (a.className != "tr-node")return;
        this.checkParent(a);
        gObj.observer.publish("SelectIndex", null)
    };
    var h = function () {
        var e = [];
        var t = $(cx.dijit.getId(this.opts.id)).find(".tr-checked");
        for (var a = 0; a < t.length; a++) {
            if (t[a].isLeaf != !0)continue;
            e.push(t[a].data)
        }
        return e
    };
    var x = function () {
        var e = $(cx.dijit.getId(this.opts.id)).find(".tr-checked");
        var t;
        for (t = 0; t < e.length; t++) {
            this.setCheckState(e[t], 0)
        }
    };
    var m = function () {
        var e = $(cx.dijit.getId(this.opts.id)).find(".tr-selected");
        var t;
        for (t = 0; t < e.length; t++) {
            e[t].className = "tr-text"
        }
    };
    var p = e.prototype;
    p._createNode = t;
    p._createLeaf = a;
    p.createNodeLeaf = n;
    p.clear = r;
    p.buildTree = i;
    p.setCheckState = o;
    p.checkChild = c;
    p.checkParent = s;
    p.checkItem = l;
    p.selectItem = d;
    p.getNode = u;
    p.onExpand = f;
    p.onCheckNode = v;
    p.onCheckLeaf = g;
    p.getChecked = h;
    p.clearChecked = x;
    p.clearSelected = m;
    return e
}();
cx.ctrl.ValButton = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {value: "", plugin: null, readonly: !1, field: null};
        cx.extend(t.data, e);
        t.wndTitle = null;
        t.wndButton = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-valbutton";
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.extend(a, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.domClass.add(t.target, n)
        } else {
            var r = {};
            if (a.id) r.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, r)
        }
        t.target.wnd = t;
        t.wndTitle = cx.dom.create("div", "text", t.target, null);
        t.wndButton = cx.dom.create("div", "iocn", t.target, {innerHTML: "···"});
        var i = function () {
            var e = 24, a = 16;
            var n;
            var r = cx.dom.getSize(t.target);
            r.w = r.w > 10 ? r.w : 150;
            r.h = r.h > 10 ? r.h : 20;
            n = "width:" + (r.w - e - 4 - 3) + "px;height:" + r.h + "px;line-height:" + r.h + "px;";
            t.wndTitle.style.cssText = n;
            n = "margin-top:" + (r.h - a) / 2 + "px";
            t.wndButton.style.cssText = n
        };
        i();
        t.val(a.value);
        var o = a.readonly;
        a.readonly = !a.readonly;
        t.readonly(o);
        var c = function (e) {
            e.preventDefault();
            if (!a.readonly && a.plugin && a.plugin != "") {
                var n = 1;
                var r = {};
                for (var i in a) {
                    r[i] = a[i];
                    if (cx.isStr(a[i]) && a[i] != "" && cx.regex.refVariable.test(a[i])) {
                        var o = a[i].match(cx.regex.refVariable);
                        r[i] = cx.frm.FormAtt.getValue(o[1]);
                        if (!r[i] || r[i] == "") {
                            n = 0;
                            break
                        }
                    }
                }
                if (!n)return;
                r.onOk = new Caller(function (e) {
                    if (a.field && a.field != "") t.val(e[a.field]); else t.val(e)
                });
                RunPlugin(a.plugin, r)
            }
        };
        t.target.onResize = i();
        t.wndButton.onclick = c
    };
    var a = function (e) {
        var t = this;
        if (arguments.length == 0) {
            return t.data.value
        } else {
            t.data.value = e;
            cx.dom.setInnerHTML(t.wndTitle, e)
        }
    };
    var n = function (e) {
        var t = this;
        if (arguments.length == 0) {
            return t.data.readonly
        } else {
            if (e != t.data.readonly) {
                if (t.data.readonly) {
                    cx.domClass.remove(t.wndButton, "c_gray");
                    cx.domClass.remove(t.target, "formtable-readonly")
                }
                t.data.readonly = e;
                if (t.data.readonly) {
                    cx.domClass.add(t.wndButton, "c_gray");
                    cx.domClass.add(t.target, "formtable-readonly")
                }
            }
        }
    };
    cx.inherits(e, cx.ctrl.IControl);
    var r = e.prototype;
    r.create = t;
    r.val = a;
    r.readonly = n;
    return e
}();
cx.ui.IMenu = function () {
    var e = function (e) {
    };
    var t = function () {
    };
    var a = function () {
    };
    var n = function (e, t, a) {
    };
    var r = function (e) {
        CallFunc(e)
    };
    var i = function (e, t, a) {
    };
    var o = e.prototype;
    o.create = t;
    o.destroy = a;
    o.preExecute = n;
    o.execute = r;
    o.postExecute = i;
    return e
}();
cx.ui.ContextMenu = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.curEtt = null;
        t.data = {
            func: [],
            funcgrp: [],
            common: [],
            entityGrp: {},
            _CommDefDispOrder: "1",
            _EntityDispOrder: "2",
            _ConstContextMenu: "contextmenu"
        };
        cx.extend(t.data, e);
        t.target = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        t.init();
        if (e) {
            t.target = e
        } else {
            var n = {};
            if (a.id && a.id != "") n.id = a.id;
            t.target = $(cx.dom.create("div", null, cx.dom.body(), n)).menu()
        }
        t.target.wnd = t
    };
    var a = function () {
        cx.dom.remove(this.target)
    };
    var n = function () {
        var e = this;
        var t = e.data;
        var a;
        t.common = [];
        cx.array.forEach(t.funcgrp, function (e) {
            if (e.target == t._ConstContextMenu) {
                for (a = 0; a < t.func.length; a++) {
                    if (t.func[a].grp == e.name) {
                        t.func[a].name = gLoc ? t.func[a].namec : t.func[a].namee;
                        if (e.disporder == t._CommDefDispOrder) {
                            t.common.push(t.func[a])
                        } else if (e.disporder == t._EntityDispOrder) {
                            t.entityGrp[e.name] = t.entityGrp[e.name] || [];
                            t.entityGrp[e.name].push(t.func[a])
                        }
                    }
                }
            }
        })
    };
    var r = function () {
        if (this.isExistItem() && this.data.common.length > 0) this.addSeparator(this.data.common[0].grp);
        for (var e = 0; e < this.data.common.length; e++) {
            this.append(this.data.common[e])
        }
    };
    var i = function (e) {
        if (this.isExistItem() && e.length > 0) this.addSeparator(e[0].grp);
        for (var t = 0; t < e.length; t++) {
            this.append(e[t])
        }
    };
    var o = function (e) {
        var t = gObj.entity.byMajorMinor(e.major, e.minor);
        if (t && cx.isObj(t.func)) {
            if (cx.isArr(t.func.cmenu)) {
                this.addEntityByGrps(t.func.cmenu)
            }
        } else if (e.target.attributes && e.target.attributes.menugrp) {
            this.addEntityByGrps([e.target.attributes.menugrp])
        } else {
            this.addComm()
        }
    };
    var c = function (e) {
        var t;
        var a, n;
        for (a = 0; a < e.length; a++) {
            t = this.data.entityGrp[e[a]];
            if (this.isExistItem() && t.length > 0) this.addSeparator(e[a]);
            for (n = 0; n < t.length; n++) {
                this.append(t[n])
            }
        }
    };
    var s = function (e) {
        this.target.menu("appendItem", {separator: !0});
        cx.domClass.add(this.getLastItem(), e)
    };
    var l = function (e) {
        var t = this;
        var a = e.callback || function () {
                var a = gObj.func.findPluginRun(e.plugin);
                if (a && a.pluginDef && a.pluginDef.runn == 0) {
                    a.plugin.destroySelf()
                }
                RunPlugin(e.plugin, t.curEtt)
            };
        var n = "";
        var r = gObj.plugin.byName(e.plugin);
        if (r) {
            if (gObj.access.canUseFunc(e.plugin) != !0)return; else {
                n = gObj.plugin.getIconCls(r.dir, r.icon, 16) + " icon-16"
            }
        }
        if (cx.isStr(e.icon) && e.icon != "") n = cx.path.get16Icon(e.icon);
        t.target.menu("appendItem", {text: e.name, iconCls: n, onclick: a});
        cx.domClass.add(this.getLastItem(), e.grp)
    };
    var d = function () {
        this.curEtt = null;
        this.target.children("div.menu-item").each(function () {
            $(this).remove()
        });
        this.target.children("div.menu-sep").each(function () {
            $(this).remove()
        })
    };
    var u = function () {
        this.target.children("div.Comcontextmenu").each(function () {
            $(this).remove()
        })
    };
    var f = function () {
        var e = this.target[0].children.length - 1;
        return this.target[0].children[e]
    };
    var v = function () {
        this.target.menu("hide")
    };
    var g = function () {
        var e = this.target[0].children.length - 2;
        return e >= 0
    };
    var h = function (e) {
        var t = this.target.menu("findItem", e.name);
        if (t && cx.domClass.has(t.target, e.grp)) {
            this.target.menu("removeItem", t.target)
        }
    };
    var x = function (e) {
        var t = gObj.entity.byMajorMinor(e.major, e.minor);
        if (t && cx.isObj(t.func)) {
            if (cx.isArr(t.func.cmenu)) {
                this.removeByGrps(t.func.cmenu)
            }
        } else if (e.target.attributes && e.target.attributes.menugrp) {
            this.removeByGrps([e.target.attributes.menugrp])
        } else {
            this.clearComm()
        }
    };
    var m = function (e) {
        for (var t = e.length - 1; t >= 0; t--) {
            $("." + e[t], this.target[0]).remove()
        }
    };
    var p = function (e, t) {
        this.curEtt = t;
        this.target.menu("show", e)
    };
    cx.inherits(e, cx.ui.IMenu);
    var b = e.prototype;
    b.create = t;
    b.destroy = a;
    b.init = n;
    b.addComm = r;
    b.addCustom = i;
    b.addEntityByEtt = o;
    b.addEntityByGrps = c;
    b.addSeparator = s;
    b.append = l;
    b.clear = d;
    b.clearComm = u;
    b.getLastItem = f;
    b.hide = v;
    b.isExistItem = g;
    b.remove = h;
    b.removeByEtt = x;
    b.removeByGrps = m;
    b.show = p;
    return e
}();
cx.ui.MenuAccordion = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {func: [], funcgrp: [], noDisp: []};
        cx.extend(t.data, e);
        t.target = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-accordion";
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.domClass.add(t.target, n);
            cx.dom.empty(t.target)
        } else {
            var r = {};
            if (a.id && a.id != "") r.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n + " full_0", a.container, r)
        }
        t.target.wnd = t;
        t.createGrps()
    };
    var a = function () {
        if (this.target) {
            cx.dom.remove(this.target);
            this.target = null
        }
    };
    var n = function () {
        var e = this;
        var t = e.data;
        var a = cx.dom.create("ul", "acd-ul", e.target);
        cx.array.forEach(t.funcgrp, function (t) {
            if (t.glgrp || t.target != "menu")return;
            var n = cx.dom.create("li", "acd-ul-li", a);
            var r = cx.dom.create("a", "acd-group", n);
            var i = cx.dom.create("div", "acd-group-icon acd-group-icon-collapse", r, null);
            cx.dom.create("div", "acd-group-text", r, {innerHTML: gLoc ? t.namec : t.namee});
            var o = e.createMenu2(t, n);
            r.onclick = function () {
                cx.domClass.toggle(i, "acd-group-icon-collapse");
                cx.domClass.toggle(i, "acd-group-icon-expand");
                cx.domClass.toggle(o, "hide")
            }
        })
    };
    var r = function (e, t) {
        var a = this.data;
        var n, r;
        var i, o;
        i = cx.dom.create("ul", "acd-group-ul hide", t);
        o = cx.dom.create("li", "acd-menu-list", i);
        for (var c = 0; c < a.func.length; c++) {
            n = a.func[c];
            if (n.grp != e.name)continue;
            if (cx.array.indexOf(a.noDisp, n.plugin) >= 0)continue;
            r = gObj.plugin.byName(n.plugin);
            if (!r)continue;
            this.createFunc(e, n, r, o)
        }
        return i
    };
    var i = function (e, t, a, n) {
        var r = this;
        var i = cx.dom.create("div", "acd-menu-item", n);
        var o = cx.dom.create("a", null, i, {id: e.name + a.name});
        cx.dom.create("div", "acd-menu-icon " + gObj.plugin.getIconCls(a.dir, a.icon, 24) + " icon-24", o);
        cx.dom.create("div", "acd-menu-text", o, {innerHTML: gLoc ? a.titlec : a.titlee});
        i.onclick = function (e) {
            e.preventDefault();
            r.preExecute(t.id, a, o);
            r.execute(t.id);
            r.postExecute(t.id, a, o)
        }
    };
    var o = function () {
        cx.dom.setVisible(this.target, !0)
    };
    var c = function () {
        cx.dom.setVisible(this.target, !1)
    };
    cx.inherits(e, cx.ui.IMenu);
    var s = e.prototype;
    s.create = t;
    s.destroy = a;
    s.createGrps = n;
    s.createMenu2 = r;
    s.createFunc = i;
    s.show = o;
    s.hide = c;
    return e
}();
cx.ui.MenuList = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {plugins: [], iconSize: 24};
        cx.extend(t.data, e);
        t.target = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.domClass.add(t.target, "cx-menu01");
            cx.dom.empty(t.target)
        } else {
            var r = {};
            if (a.id && a.id != "") r.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            cx.dom.empty(a.container);
            t.target = cx.dom.create("div", "cx-menu01 full_0", a.container, r)
        }
        t.target.wnd = t;
        var i, o, c;
        var s, l;
        i = cx.dom.create("ul", "menu01-list", t.target, null);
        cx.array.forEach(a.plugins, function (e) {
            l = gObj.plugin.byName(e);
            if (l) {
                o = cx.dom.create("li", "menu01-item", i, null);
                c = cx.dom.create("a", null, o, null);
                s = gObj.plugin.getIconCls(l.dir, l.icon, a.iconSize);
                cx.dom.create("div", "menu01-icon " + s, c, null);
                cx.dom.create("div", "menu01-text", c, {innerHTML: gLoc ? l.titlec : l.titlee});
                n(c, l)
            }
        })
    };
    var a = function () {
        if (this.target) {
            cx.dom.remove(this.target);
            this.target = null
        }
    };
    var n = function (e, t) {
        e.onclick = function (e) {
            e.preventDefault();
            CallPlugin(t.name)
        }
    };
    cx.inherits(e, cx.ui.IMenu);
    var r = e.prototype;
    r.create = t;
    r.destroy = a;
    return e
}();
cx.ui.MenuStart = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {func: [], funcgrp: [], position: "left", direction: "top", target: "menu"};
        cx.extend(t.data, e);
        t.target = null;
        t.lastMenu = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-menustart";
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.domClass.add(t.target, n);
            cx.extend(t.data, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.dom.empty(t.target)
        } else {
            var r = {};
            if (a.id && a.id != "") r.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, r)
        }
        t.target.wnd = t;
        a.position = cx.consts.getPosition(a.position);
        a.direction = cx.consts.getDirection(a.direction);
        switch (a.position) {
            case 3:
            case 4:
                switch (a.direction) {
                    case 1:
                    case 2:
                        break;
                    default:
                        a.direction = 1;
                        break
                }
                break
        }
        t.createMenu();
        if (a.fastToolBar && a.fastToolBar != "") c(t, a.fastToolBar);
        if (a.handler && a.handler == "on") s(t);
        if (a.regionBar && a.regionBar != "") l(t, a.regionBar)
    };
    var a = function () {
        var e = this;
        if (e.fastToolBar) {
            e.fastToolBar.destroy();
            e.fastToolBar = null
        }
        cx.dom.remove(e.handle);
        cx.dom.remove(e.target)
    };
    var n = function () {
        var e = this;
        var t = e.data;
        var a = cx.array.gets(t.funcgrp, {target: t.target});
        e.createMenu1(a)
    };
    var r = function (e) {
        var t = this;
        var a;
        var n;
        cx.dom.create("div", "menu0", t.target, null);
        var r = cx.dom.create("div", "menu1", t.target, null);
        var i = cx.dom.create("ul", "menu1-ul", r);
        cx.dom.create("div", "menu1-seprator", i, null);
        for (n = 0; n < e.length; n++) {
            if (e[n].glgrp != "")continue;
            var o = e[n];
            if (gObj.access.isViewMenu(o)) {
                if (o.glgrp || o.target != "menu")return;
                var c = cx.dom.create("li", "menu1-ul-li", i);
                var s = cx.dom.create("a", "menu1-item", c);
                cx.dom.create("div", "menu1-icon" + " " + cx.path.get32Icon(o.icon), s, null);
                cx.dom.create("div", "menu1-text", s, {innerHTML: gLoc ? o.namec : o.namee});
                cx.dom.create("div", "menu1-seprator", c, null);
                s.menu2 = t.createMenu2(e, o, s);
                s.onclick = function () {
                    var e = this;
                    if (!cx.isDef(a)) {
                        cx.domClass.add(e, "menu1-item-selected");
                        cx.domClass.remove(e.menu2, "hide");
                        a = e
                    } else if (a !== e) {
                        cx.domClass.remove(a, "menu1-item-selected");
                        cx.domClass.add(e, "menu1-item-selected");
                        cx.domClass.add(a.menu2, "hide");
                        cx.domClass.remove(e.menu2, "hide");
                        a = e
                    } else if (a === e) {
                        if (!cx.domClass.has(e.menu2, "hide")) {
                            cx.domClass.add(e.menu2, "hide")
                        } else {
                            cx.domClass.remove(e.menu2, "hide")
                        }
                    }
                }
            }
        }
    };
    var i = function (e, t, a) {
        var n = cx.dom.create("div", "menu2", this.target);
        var r = cx.dom.create("ul", "menu2-ul", n);
        cx.array.forEach(e, function (e) {
            if (e.glgrp != t.name || !gObj.access.isViewMenu(e))return;
            var a = cx.dom.create("li", "menu2-ul-li", r, null);
            var i = cx.dom.create("a", "menu2-group", a);
            cx.dom.create("div", "menu2-group-text", i, {innerHTML: gLoc ? e.namec : e.namee});
            var o = this.createMenu3({
                group: e, hideCall: function () {
                    cx.domClass.add(n, "hide")
                }
            });
            a.appendChild(o)
        }, this);
        var i = cx.dom.getPosSize(this.target.parentNode);
        var o = cx.dom.getPosSize(a);
        var c = cx.dom.getPosSize(n);
        var s, l, d;
        s = o.x + o.w + 1;
        l = o.y + o.h / 2 - c.h / 2;
        d = l + c.h;
        if (d > i.h) l = i.h - c.h;
        if (l < 0) l = 0;
        cx.dom.setStyle(n, {left: 4 + s + "px", top: l + "px"});
        cx.domClass.add(n, "hide");
        return n
    };
    var o = function (e) {
        var t = this;
        var a = t.data;
        var n = e.group;
        var r = cx.dom.create("ul", "menu2-group-ul");
        var i = cx.dom.create("li", "menu2-group-ul-li menu3", r);
        var o, c, s, l;
        var d;
        for (d = 0; d < a.func.length; d++) {
            o = a.func[d];
            if (o.grp != n.name || !gObj.access.canUseFunc(o.plugin))continue;
            c = gObj.plugin.byName(o.plugin);
            if (!c)continue;
            s = cx.dom.create("div", "menu3-item", i);
            l = cx.dom.create("a", null, s);
            cx.dom.create("div", "menu3-item-icon " + gObj.plugin.getIconCls(c.dir, c.icon, 32), l);
            cx.dom.create("div", "menu3-item-text", l, {innerHTML: gLoc ? o.namec : o.namee});
            s.funcId = o.id;
            s.func = o;
            s.onmousedown = function (a) {
                switch (a.button) {
                    case 0:
                        CallFunc(this.func.id);
                        if (cx.isFunc(e.hideCall)) {
                            e.hideCall()
                        }
                        break;
                    case 2:
                        if (t.fastToolbar) {
                            t.fastToolbar.append(this.func, !0)
                        }
                        break
                }
            }
        }
        return r
    };
    var c = function (e, t) {
        var a = [];
        var n = gObj.user.tools[gObj.user.sys] || [];
        var r;
        var i;
        if (n) {
            for (i = 0; i < n.length; i++) {
                r = cx.array.get1(e.data.func, {id: n[i]});
                if (r && gObj.access.canUseFunc(r.plugin)) {
                    a.push(r)
                }
            }
        }
        var o = cx.dom.getDomNode(t);
        if (o) {
            e.fastToolbar = new cx.ui.ToolBar({func: a, editable: !0});
            e.fastToolbar.create(o);
            e.receiver = cx.dom.create("div", "cx-dnd-fasttool", cx.dom.body(), null);
            cx.dom.setVisible(e.receiver, !1)
        }
    };
    var s = function (e) {
        var t = e.target.parentNode;
        var a = t.parentNode;
        var n = cx.parser.getOptions($(t).attr("data-options"));
        var r = n.region;
        var i = null;
        if (r && r != "") i = a.wnd;
        e.handle = cx.dom.create("div", "menustart-fold-show", cx.dom.body(), null);
        e.handle.onclick = function (a) {
            a.preventDefault();
            if (cx.domClass.has(e.target, "hide")) {
                cx.domClass.remove(e.target, "hide");
                cx.domClass.remove(e.handle, "menustart-fold-hide");
                cx.domClass.add(e.handle, "menustart-fold-show");
                if (i) {
                    i.expand(r)
                } else {
                    cx.domClass.remove(t, "hide")
                }
            } else {
                if (i) {
                    i.collapse(r)
                } else {
                    cx.domClass.add(t, "hide")
                }
                cx.domClass.add(e.target, "hide");
                cx.domClass.remove(e.handle, "menustart-fold-show");
                cx.domClass.add(e.handle, "menustart-fold-hide")
            }
        }
    };
    var l = function (e, t) {
        var a = cx.byId(t);
        if (a) {
            var n = function () {
                cx.domClass.add(e.target, "hide")
            };
            var r = function () {
                cx.domClass.remove(e.target, "hide")
            };
            a.onExpand = r;
            a.onCollapse = n
        }
    };
    cx.inherits(e, cx.ui.IMenu);
    var d = e.prototype;
    d.create = t;
    d.destroy = a;
    d.createMenu = n;
    d.createMenu1 = r;
    d.createMenu2 = i;
    d.createMenu3 = o;
    return e
}();
cx.ui.MenuTool = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {
            func: [],
            funcgrp: [],
            noDisp: [],
            position: "top",
            direction: "left",
            isToolbar: !1,
            sepWidth: "0.25em",
            target: "menu",
            iconSize: 32
        };
        cx.extend(t.data, e);
        t.target = null;
        t.lastMenu = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-menutool";
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.domClass.add(t.target, n);
            cx.extend(t.data, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.dom.empty(t.target)
        } else {
            var r = {};
            if (a.id && a.id != "") r.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, r)
        }
        t.target.wnd = t;
        a.position = cx.consts.getPosition(a.position);
        a.direction = cx.consts.getDirection(a.direction);
        switch (a.position) {
            case 1:
            case 2:
                switch (a.direction) {
                    case 3:
                    case 4:
                        break;
                    default:
                        a.direction = 3;
                        break
                }
                break;
            case 3:
            case 4:
                switch (a.direction) {
                    case 1:
                    case 2:
                        break;
                    default:
                        a.direction = 1;
                        break
                }
                break
        }
        t.createMenu1()
    };
    var a = function () {
        var e = this;
        var t = e.data;
        var a = cx.array.gets(t.funcgrp, {target: t.target});
        var n, r;
        var i = "width:" + t.iconSize + "px;height:" + t.iconSize + "px;";
        var o, c;
        switch (t.direction) {
            case 1:
                i += "margin-bottom:" + t.sepWidth;
                break;
            case 2:
                i += "margin-top:" + t.sepWidth;
                break;
            case 3:
                i += "display:inline-block;float:left;margin-right:" + t.sepWidth;
                break;
            case 4:
                i += "display:inline-block;float:right;margin-left:" + t.sepWidth;
                break
        }
        if (!t.isToolbar) {
            n = cx.dom.create("ul", "menu1", e.target, null);
            r = cx.dom.create("li", "menu1-list", n, null)
        } else {
            n = cx.dom.create("ul", "toolbar1", e.target, null);
            r = cx.dom.create("li", "menu1-list", n, null)
        }
        var s = function (a, n) {
            var r, o;
            if (!t.isToolbar) {
                r = cx.dom.create("div", "menu1-item", n, {style: i});
                o = cx.dom.create("div", "menu1-link", r, null);
                cx.dom.create("div", "menu1-icon " + a.icon, o);
                cx.dom.create("div", "menu1-text", o, {innerHTML: gLoc ? a.namec : a.namee})
            } else {
                r = cx.dom.create("div", "menu1-item", n, {style: i});
                o = cx.dom.create("div", "menu1-link", r, null);
                cx.dom.create("div", "menu1-icon " + a.icon, o)
            }
            var c = e.createMenu2(e, a, r);
            $(r).mouseover(function () {
                if (r != e.lastMenu) {
                    e.hideMenu2();
                    e.showMenu2(c);
                    e.posMenu2(c, r);
                    e.lastMenu = r
                }
            });
            $(r).mouseout(function () {
                e.hideMenu2();
                e.lastMenu = null
            })
        };
        var l = function (a, n) {
            var r, o, c;
            r = cx.dom.create("div", "menu1-item", null, {style: i});
            o = cx.dom.create("div", "menu1-link", r, null);
            c = gObj.plugin.byName(a.plugin);
            if (!c || gObj.access.canUseFunc(a.plugin) != !0)return;
            cx.dom.create("div", "menu1-icon icon-" + t.iconSize + " " + gObj.plugin.getIconCls(c.dir, c.icon, t.iconSize), o, null);
            switch (t.direction) {
                case 2:
                    cx.dom.insertFirst(r, n);
                    break;
                default:
                    cx.dom.append(r, n);
                    break
            }
            if (!cx.isMobile) {
                addTip(r, gLoc ? a.namec : a.namee)
            }
            $(r).on(cx.Event.CLICK, function (t) {
                t.preventDefault();
                e.activeTool(r);
                CallFunc(a.id)
            })
        };
        if (!t.isToolbar) {
            for (o = 0; o < a.length; o++) {
                s(a[o], r)
            }
        } else {
            var d;
            if (a.length > 0) {
                for (o = 0; o < a.length; o++) {
                    d = cx.array.gets(e.data.func, {grp: a[o].name});
                    for (c = 0; c < d.length; c++) {
                        l(d[c], r)
                    }
                }
            } else {
                d = cx.array.gets(e.data.func, {grp: t.target});
                for (c = 0; c < d.length; c++) {
                    l(d[c], r)
                }
            }
        }
    };

    function n(e, t, a) {
        var n = [], i;
        var o, c, s, l;
        var d;
        cx.array.forEach(e.data.funcgrp, function (e) {
            if (e.glgrp == t.name) n.push(e)
        });
        if (n.length < 1) n.push(t);
        o = cx.dom.create("div", "menu2 hide", a, null);
        c = cx.dom.create("ul", "menu2-ul", o, null);
        for (d = 0; d < n.length; d++) {
            i = n[d];
            s = cx.dom.create("li", "menu2-ul-li", c, null);
            l = cx.dom.create("a", "menu2-group", s, null);
            cx.dom.create("div", "menu2-group-text", l, {innerHTML: gLoc ? i.namec : i.namee});
            r(e, i, s, o)
        }
        return o
    }

    function r(e, t, a, n) {
        var r = cx.dom.create("ul", "menu2-group-ul", a);
        var i = cx.dom.create("li", "menu2-group-ul-li menu3", r);
        var o, c, s, l;
        var d;
        for (d = 0; d < e.data.func.length; d++) {
            o = e.data.func[d];
            if (o.grp != t.name) {
                continue
            }
            c = gObj.plugin.byName(o.plugin);
            if (!c || gObj.access.canUseFunc(o.plugin) != !0)continue;
            s = cx.dom.create("div", "menu3-item", i);
            l = cx.dom.create("a", null, s);
            cx.dom.create("div", "menu3-item-icon icon-" + e.data.iconSize + " " + gObj.plugin.getIconCls(c.dir, c.icon, e.data.iconSize), l, null);
            cx.dom.create("div", "menu3-item-text", l, {innerHTML: gLoc ? o.namec : o.namee});
            s.funcId = o.id;
            s.func = o;
            s.onclick = function () {
                cx.domClass.add(n, "hide");
                CallFunc(this.func.id)
            }
        }
        return r
    }

    var i = function (e, t) {
        e.onclick = function () {
            CallFunc(t.id)
        }
    };
    var o = function () {
        var e = $(this.target).find(".menu2");
        for (var t = 0; t < e.length; t++) {
            cx.domClass.add(e[t], "hide")
        }
    };
    var c = function (e) {
        cx.domClass.remove(e, "hide")
    };
    var s = function (e, t) {
        if (e.possed)return;
        var a = cx.window.getClientSize();
        var n = cx.dom.getPosSizeBody(this.target);
        var r = cx.dom.getPosSizeBody(t);
        var i = cx.dom.getPosSizeBody(e);
        var o, c;
        switch (this.data.position) {
            case 1:
            case 2:
                o = r.x + (r.w - i.w) / 2;
                if (o <= 0) o = 0;
                if (o + i.w > a.w) o = a.w - i.w;
                o = o - r.x + (r.x - n.x);
                break;
            case 3:
            case 4:
                c = r.y + (r.h - i.h) / 2;
                if (c <= 0) c = 0;
                if (c + i.h > a.h) c = a.h - i.h;
                c = c - r.y + (r.y - n.y);
                break
        }
        switch (this.data.position) {
            case 1:
                cx.dom.setStyle(e, {left: o + "px", top: r.h + 1 + "px"});
                break;
            case 2:
                cx.dom.setStyle(e, {left: o + "px", bottom: r.h - 0 + "px"});
                break;
            case 3:
                cx.dom.setStyle(e, {left: r.w - 0 + "px", top: c + "px"});
                break;
            case 4:
                cx.dom.setStyle(e, {right: r.w - 0 + "px", top: c + "px"});
                break
        }
        e.possed = !0
    };
    var l = function (e) {
        var t = $(this.target).find(".active");
        for (var a = 0; a < t.length; a++) {
            if (t[a] != e) {
                cx.domClass.remove(t[a], "active")
            }
        }
        cx.domClass.add(e, "active")
    };
    cx.inherits(e, cx.ui.IMenu);
    var d = e.prototype;
    d.create = t;
    d.createMenu1 = a;
    d.createMenu2 = n;
    d.clickFunc = i;
    d.hideMenu2 = o;
    d.showMenu2 = c;
    d.posMenu2 = s;
    d.activeTool = l;
    return e
}();
cx.ui.MenuTop = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {func: [], funcgrp: [], noDisp: []};
        cx.extend(t.data, e);
        t.target = null;
        t.lastMain = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.domClass.add(t.target, "cx-menutop");
            cx.dom.empty(t.target)
        } else {
            var n = {};
            if (a.id && a.id != "") n.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            cx.dom.empty(a.container);
            t.target = cx.dom.create("div", "cx-menutop", a.container, n)
        }
        t.target.wnd = t;
        t.createMenu1()
    };
    var a = function () {
        var e = this;
        var t = cx.array.gets(e.data.funcgrp, {target: "menu"});
        var a = cx.dom.create("ul", "topmenu1", e.target);
        var n = cx.dom.create("li", "topmenu1-list", a);
        var r;
        var i;
        var o = function (t, a) {
            var n = cx.dom.create("div", " topmenu1-item", a);
            var r = cx.dom.create("a", "topmenu1-link", n, null);
            cx.dom.create("div", "topmenu1-icon " + t.icon + " icon-32", r);
            cx.dom.create("div", "topmenu1-text", r, {innerHTML: gLoc ? t.namec : t.namee});
            e.createMenu2(e, t, n);
            $(n).mouseover(function () {
                $(this).children(".topmenu2").css("display", "block")
            });
            $(n).mouseout(function () {
                $(this).children(".topmenu2").css("display", "none")
            })
        };
        for (i = 0; i < t.length; i++) {
            r = t[i];
            o(r, n)
        }
    };
    var n = function (e, t, a) {
        var n = cx.array.gets(e.data.func, {grp: t.name});
        var i, o, c, s, l;
        var d;
        i = cx.dom.create("div", "topmenu2 ", a, null);
        for (d = 0; d < n.length; d++) {
            o = n[d];
            c = gObj.plugin.byName(o.plugin);
            if (!c || gObj.access.canUseFunc(o.plugin) != !0)continue;
            s = cx.dom.create("div", "topmenu2-item", i, null);
            l = cx.dom.create("a", "topmenu2-link", s, null);
            cx.dom.create("div", "topmenu2-icon " + gObj.plugin.getIconCls(c.dir, c.icon, 32), l, null);
            cx.dom.create("div", "topmenu2-text ", l, {innerHTML: gLoc ? o.namec : o.namee});
            r(l, o)
        }
    };
    var r = function (e, t) {
        e.onclick = function () {
            CallFunc(t.id)
        }
    };
    cx.inherits(e, cx.ui.IMenu);
    var i = e.prototype;
    i.create = t;
    i.createMenu1 = a;
    i.createMenu2 = n;
    return e
}();
cx.ui.StatusBar = function () {
    var e = function (e) {
        cx.base(this, e);
        this.items = {}
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-statusbar";
        var r, o, c;
        var s;
        t.items = {};
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.domClass.add(t.target, n);
            cx.extend(t.data, cx.parser.getOptions($(t.target).attr("data-options")));
            r = cx.parser.getChildren(t.target)
        } else {
            var l = {};
            if (a.id && a.id != "") l.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n, a.container, l)
        }
        t.target.wnd = t;
        if (e) {
            for (s = 0; s < r.length; s++) {
                o = r[s];
                cx.domClass.add(o, "statusbar-item");
                c = cx.parser.getOptions($(o).attr("data-options"));
                if (!c.name || c.name == "") c.name = o.id;
                i(t, c["name"], o)
            }
        }
    };
    var a = function () {
        delete this.items;
        cx.base(this, "destroy")
    };
    var n = function (e, t) {
        var a = cx.dom.create("div", "statusbar-item " + (t ? t : ""), self.target, null);
        i(this, e, a)
    };
    var r = function (e, t) {
        var a = this.items[e];
        if (a) {
            a.innerHTML = t
        }
    };
    var i = function (e, t, a) {
        if (t && a) {
            e.items[t] = a
        }
    };
    cx.inherits(e, cx.ctrl.IControl);
    var o = e.prototype;
    o.create = t;
    o.destroy = a;
    o.addIndicator = n;
    o.setInfo = r;
    return e
}();
cx.ui.ToolBar = function () {
    var e = function (e) {
        var t = this;
        cx.base(t, e);
        t.data = {func: [], movable: !0, editable: !1, closable: !1};
        cx.extend(t.data, e);
        t.els = {};
        t.handle = null;
        t.delBox = null
    };
    var t = function (e) {
        var t = this;
        var a = t.data;
        var n = "cx-toolbar";
        if (e) {
            t.target = cx.dom.getDomNode(e);
            cx.domClass.add(t.target, n);
            cx.extend(t.data, cx.parser.getOptions($(t.target).attr("data-options")));
            cx.dom.empty(t.target)
        } else {
            var r = {};
            if (a.id && a.id != "") r.id = a.id;
            a.container = cx.dom.getDomNode(a.container);
            t.target = cx.dom.create("div", n + " cx-pos-toolbar-right " + "ToolBar_" + t.data.grp, a.container, r)
        }
        t.target.wnd = t;
        t.closable();
        t.movable();
        t.editable();
        for (var i = a.func.length - 1; i >= 0; i--) {
            if (!t.data.grp || t.data.grp == "" || a.func[i].grp == t.data.grp) {
                if (gObj.access.canUseFunc(a.func[i].plugin)) {
                    t.append(a.func[i], !1)
                }
            }
        }
    };
    var a = function () {
        cx.dom.remove(this.delBox);
        cx.dom.remove(this.target)
    };
    var n = function (e, t) {
        var a = this;
        if (a.data.editable) {
            $(a.target).show()
        }
        if (a.els[e.id]) {
            return
        }
        var n = gObj.plugin.byName(e.plugin);
        if (!n || gObj.access.canUseFunc(e.plugin) != !0)return;
        var r = cx.dom.create("div", "toolbar-itemContainer", a.target, null);
        cx.dom.create("div", "toolbar-itemSpliter", r, null);
        var i = cx.dom.create("div", "toolbar-itembg", r, null);
        var o = cx.dom.create("div", "toolbar-item " + gObj.plugin.getIconCls(n.dir, n.icon, 24), i, {func: e});
        $(i).on(cx.Event.CLICK, function (t) {
            t.preventDefault();
            CallFunc(e.id)
        });
        if (!cx.isMobile) {
            addTip(o, gLoc == 1 ? e.namec : e.namee)
        }
        if (a.data.editable) {
            $(i).draggable({
                edge: 8,
                handle: ".toolbar-item",
                revert: !0,
                proxy: "clone",
                deltaX: -10,
                deltaY: 10,
                onBeforeDarg: function (e) {
                },
                onStartDrag: function (e) {
                    cx.dom.setVisible(a.delBox, !0)
                },
                onDrag: function (e) {
                },
                onStopDrag: function (e) {
                    $(a.delBox).hide();
                    if (a.target.children.length == 1) {
                        $(a.target).hide()
                    }
                }
            })
        }
        a.els[e.id] = r;
        if (t) {
            a.save()
        }
    };
    var r = function () {
        var e = this;
        if (e.data.closable) {
            var t = cx.dom.create("div", "toolbar-handlerbg", e.target, null);
            cx.dom.create("div", "toolbar-close", t, {
                onclick: function (t) {
                    t.preventDefault();
                    e.destroy()
                }
            })
        }
    };
    var i = function () {
        var e = this;
        if (e.data.movable) {
            var t = cx.dom.create("div", "toolbar-handlerbg", e.target, null);
            e.handle = cx.dom.create("div", "toolbar-handler", t, null);
            $(e.target).draggable({
                handle: $(e.handle), addClasses: !1, onStartDrag: function (t) {
                    cx.domClass.remove(e.target, "cx-pos-toolbar-right");
                    cx.domClass.remove(e.target, "cx-pos-toolbar-left")
                }, onDrag: function (e) {
                }
            })
        }
    };
    var o = function () {
        var e = this;
        if (e.data.editable) {
            $(e.target).droppable({
                onDrop: function (e, t) {
                    if (t.onclick) t.onclick(e)
                }
            });
            e.delBox = cx.dom.create("div", "cx-dnd-trash", cx.dom.body(), null);
            cx.dom.setVisible(e.delBox, !1);
            $(e.delBox).droppable({
                accept: ".toolbar-itembg", onDragEnter: function (e, t) {
                }, onDragLeave: function (e, t) {
                }, onDrop: function (t, a) {
                    a = a.childNodes[0];
                    e.remove(a.func)
                }
            })
        }
    };
    var c = function (e) {
        if (this.els[e.id]) {
            cx.dom.remove(this.els[e.id]);
            delete this.els[e.id];
            this.save()
        }
    };
    var s = function () {
        var e = this;
        var t = [];
        for (var a in e.els) {
            t.push(a)
        }
        if (cx.isArr(gObj.user.tools)) {
            gObj.user.tools = {}
        }
        gObj.user.tools[gObj.user.sys] = t;
        gObj.attOper.update(99, cx.consts.SYSUSER, gObj.user.id, {tools: cx.cvt.data2String(gObj.user.tools)}, {}, new Caller(function (e, t) {
        }))
    };
    var l = function () {
        cx.dom.setVisible(this.target, !0)
    };
    var d = e.prototype;
    d.create = t;
    d.destroy = a;
    d.append = n;
    d.closable = r;
    d.movable = i;
    d.editable = o;
    d.remove = c;
    d.save = s;
    d.hide = l;
    return e
}();